fixed enabled state

pull/18777/head
Brian Coca 9 years ago committed by Matt Clay
parent df1b03d0c6
commit cffe358260

@ -309,6 +309,9 @@ def main():
if rc == 0 or (os.access(initscript, os.X_OK) and bool(glob.glob('/etc/rc?.d/S??' + unit))): if rc == 0 or (os.access(initscript, os.X_OK) and bool(glob.glob('/etc/rc?.d/S??' + unit))):
enabled = True enabled = True
# default to current state
result['enabled'] = enabled
# Change enable/disable if needed # Change enable/disable if needed
if enabled != module.params['enabled']: if enabled != module.params['enabled']:
result['changed'] = True result['changed'] = True
@ -322,7 +325,7 @@ def main():
if rc != 0: if rc != 0:
module.fail_json(msg="Unable to %s service %s: %s" % (action, unit, err)) module.fail_json(msg="Unable to %s service %s: %s" % (action, unit, err))
result['enabled'] = enabled result['enabled'] = not enabled
if module.params['state'] is not None: if module.params['state'] is not None:

Loading…
Cancel
Save