From 3c89a21e0c03503f2b6f16eefc9780fa97169ac1 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 11 Aug 2016 09:23:32 -0400 Subject: [PATCH] fixes corner case for systemd services when both unit file and sysv init script exist Thanks to @olfway for fix. fixes #3764 --- lib/ansible/modules/system/service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/system/service.py b/lib/ansible/modules/system/service.py index 724f39baa9d..e8f50172a6e 100644 --- a/lib/ansible/modules/system/service.py +++ b/lib/ansible/modules/system/service.py @@ -496,6 +496,8 @@ class LinuxService(Service): (rc, out, err) = self.execute_command("%s is-enabled %s" % (self.enable_cmd, service_name,)) if rc == 0: return True + elif out.startswith('disabled'): + return False elif sysv_exists(service_name): return sysv_is_enabled(service_name) else: