Skip to content

Commit

Permalink
Merge pull request ansible#2340 from niksite/devel
Browse files Browse the repository at this point in the history
Fixed 'service'. Now it respect 'enabled=no' as well.
  • Loading branch information
mpdehaan committed Mar 8, 2013
2 parents 76f3351 + 03c0b8d commit c4aa72f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/service
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def main():
service.get_service_tools()

# Enable/disable service startup at boot if requested
if service.module.params['enabled']:
if service.module.params['enabled'] is not None:
# FIXME: ideally this should detect if we need to toggle the enablement state, though
# it's unlikely the changed handler would need to fire in this case so it's a minor thing.
service.service_enable()
Expand All @@ -766,7 +766,7 @@ def main():
module.fail_json(msg=out)

result['changed'] = service.changed
if service.module.params['enabled']:
if service.module.params['enabled'] is not None:
result['enabled'] = service.module.params['enabled']

if not service.module.params['state']:
Expand Down

0 comments on commit c4aa72f

Please sign in to comment.