diff --git a/plugins/modules/target.py b/plugins/modules/target.py index 280f37f..5a54966 100644 --- a/plugins/modules/target.py +++ b/plugins/modules/target.py @@ -24,8 +24,11 @@ class Module(SystemdUnitModule): ) def prepare(self): - self.unitfile = (SYSTEMD_SERVICE_CONFIG/ self.get("name")).with_stem(".target") - self.set("name", self.get(name)) + try: + self.unitfile = (SYSTEMD_SERVICE_CONFIG/ self.get("name")).with_stem(".target") + self.set("name", self.get(name)) + except KeyError: + self.set("params", self.params) self.__unit = None def header(self) -> str: