From 1c6c2e5b0d404e5e09e93d953fd49b0092026c95 Mon Sep 17 00:00:00 2001 From: nervo Date: Fri, 16 Nov 2018 15:28:54 +0100 Subject: [PATCH] Sysvinit - Enabling a service should use "defaults" if no runlevels are specified --- .../fragments/48808-sysvinit_defaults_if_no_runlevels.yaml | 2 ++ lib/ansible/modules/system/sysvinit.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/48808-sysvinit_defaults_if_no_runlevels.yaml diff --git a/changelogs/fragments/48808-sysvinit_defaults_if_no_runlevels.yaml b/changelogs/fragments/48808-sysvinit_defaults_if_no_runlevels.yaml new file mode 100644 index 00000000000..af1dfb6a331 --- /dev/null +++ b/changelogs/fragments/48808-sysvinit_defaults_if_no_runlevels.yaml @@ -0,0 +1,2 @@ +bugfixes: + - sysvinit - enabling a service should use "defaults" if no runlevels are specified diff --git a/lib/ansible/modules/system/sysvinit.py b/lib/ansible/modules/system/sysvinit.py index 3bcddd3684a..f8dd48322d1 100644 --- a/lib/ansible/modules/system/sysvinit.py +++ b/lib/ansible/modules/system/sysvinit.py @@ -267,7 +267,7 @@ def main(): # Perform enable/disable here if enabled: if location.get('update-rc.d'): - (rc, out, err) = module.run_command("%s %s enable" % (location['update-rc.d'], name)) + (rc, out, err) = module.run_command("%s %s defaults" % (location['update-rc.d'], name)) elif location.get('chkconfig'): (rc, out, err) = module.run_command("%s %s on" % (location['chkconfig'], name)) else: