diff --git a/plugins/modules/target.py b/plugins/modules/target.py index 7402dde..5cfa972 100644 --- a/plugins/modules/target.py +++ b/plugins/modules/target.py @@ -3,10 +3,10 @@ import pathlib from typing import List, Union try: - from ansible_collections.sebastian.systemd.plugins.module_utils.generic import SYSTEMD_SERVICE_CONFIG, Types + from ansible_collections.sebastian.systemd.plugins.module_utils.generic import SYSTEMD_SERVICE_CONFIG, Types, systemdbool from ansible_collections.sebastian.systemd.plugins.module_utils.module import SystemdUnitModule, installable except ImportError: - from plugins.module_utils.generic import SYSTEMD_SERVICE_CONFIG, Types + from plugins.module_utils.generic import SYSTEMD_SERVICE_CONFIG, Types, systemdbool from plugins.module_utils.module import SystemdUnitModule, installable @@ -17,12 +17,18 @@ class Module(SystemdUnitModule): name = "target" module_spec = dict( argument_spec=dict( - description=Types.str(required=True), + description=Types.str(), name=Types.str(required=True), allow_isolate=Types.bool(default=False), ), ) + def header(self) -> str: + section = super().header() + section += "AllowIsolate={}".format(systemdbool(self.get("allow_isolate", False))) + return section + + def unit(self) -> str: if self.__unit is None: self.__unit = "\n".join(