1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fixed enabled state

This commit is contained in:
Brian Coca 2016-06-01 12:34:26 -04:00 committed by Matt Clay
parent df1b03d0c6
commit cffe358260

View file

@ -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))):
enabled = True
# default to current state
result['enabled'] = enabled
# Change enable/disable if needed
if enabled != module.params['enabled']:
result['changed'] = True
@ -322,7 +325,7 @@ def main():
if rc != 0:
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: