diff --git a/lib/ansible/modules/system/sysvinit.py b/lib/ansible/modules/system/sysvinit.py index 6cefb5aebbe..82724c1c331 100644 --- a/lib/ansible/modules/system/sysvinit.py +++ b/lib/ansible/modules/system/sysvinit.py @@ -258,7 +258,7 @@ def main(): elif location.get('chkconfig'): (rc, out, err) = module.run_command("%s --level %s %s off" % (location['chkconfig'], ''.join(runlevels), name)) else: - if enabled != runlevel_status["enabled"]: + if enabled is not None and enabled != runlevel_status["enabled"]: result['changed'] = True result['status']['enabled']['changed'] = True @@ -299,7 +299,9 @@ def main(): def runme(doit): - cmd = "%s %s %s %s" % (script, doit, name, module.params['arguments']) + args = module.params['arguments'] + cmd = "%s %s %s" % (script, doit, "" if args is None else args) + # how to run if module.params['daemonize']: (rc, out, err) = daemonize(cmd)