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

Service tweaks WIP

This commit is contained in:
Michael DeHaan 2012-07-28 16:39:10 -04:00
parent aca860df9c
commit e9c4eb36d1

View file

@ -131,16 +131,14 @@ def main():
argument_spec = dict( argument_spec = dict(
name = dict(required=True), name = dict(required=True),
state = dict(choices=['running', 'started', 'stopped', 'restarted', 'reloaded']), state = dict(choices=['running', 'started', 'stopped', 'restarted', 'reloaded']),
list_items = dict(choices=['status']), enable = dict(choices=BOOLEANS)
enable = dict(choices=['on', 'off', 'true', 'false', 'yes', 'no', 'enable', 'disable', 'none'])
) )
) )
p = module.params p = module.params
name = p['name'] name = p['name']
state = p.get('state', None) state = p.get('state', None)
list_items = p.get('list_items', None) enable = module.bool(p.get('enable', None))
enable = p.get('enable', None)
# =========================================== # ===========================================
# find binaries locations on minion # find binaries locations on minion
@ -203,8 +201,6 @@ def main():
result = {"changed": changed} result = {"changed": changed}
rc, stdout, stderr = _run("%s %s status" % (SERVICE, name)) rc, stdout, stderr = _run("%s %s status" % (SERVICE, name))
if list_items == 'status':
result['status'] = stdout
module.exit_json(**result); module.exit_json(**result);