diff --git a/plugins/modules/system_service.py b/plugins/modules/system_service.py index f1deb21..a7257f9 100644 --- a/plugins/modules/system_service.py +++ b/plugins/modules/system_service.py @@ -43,6 +43,7 @@ class Module(SystemdUnitModule): def prepare(self): self.unitfile = (SYSTEMD_SERVICE_CONFIG / self.get("name")).with_stem(".service") + self.__unit = None if self.get("type", "simple") != "oneshot" and len(self.get("start")) > 1: self.module.fail_json("only oneshot services are allowed to have multiple start commands", **self.result) diff --git a/plugins/modules/target.py b/plugins/modules/target.py index 61335a9..3461ef7 100644 --- a/plugins/modules/target.py +++ b/plugins/modules/target.py @@ -25,6 +25,7 @@ class Module(SystemdUnitModule): def prepare(self): self.unitfile = (SYSTEMD_SERVICE_CONFIG/ self.get("name")).with_stem(".target") + self.__unit = None def header(self) -> str: section = super().header()