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:
parent
df1b03d0c6
commit
cffe358260
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||
|
||||
|
|
Loading…
Reference in a new issue