diff --git a/plugins/module_utils/module.py b/plugins/module_utils/module.py index 1aed131..f3cef69 100644 --- a/plugins/module_utils/module.py +++ b/plugins/module_utils/module.py @@ -350,13 +350,14 @@ def installable(_class: Type[SystemdUnitModule]): class SystemdReloadMixin: module: basic.AnsibleModule unitfile: pathlib.Path + restartable: bool = True changed: bool def post(self): if not self.changed: return systemctl = self.module.get_bin_path("systemctl", required=True) self.module.run_command([systemctl, "daemon-reload"], check_rc=True) - if self.unitfile.stem.endswith("@"): + if self.unitfile.stem.endswith("@") or not self.restartable: return (rc, _, _) = self.module.run_command([systemctl, "is-enabled", self.unitfile.name], check_rc=False) if rc == 0: