Revert "added innitial daemon-reloaded support to service module"

This reverts commit 438d87d269.
This commit is contained in:
Brian Coca 2015-06-10 12:53:34 -04:00
parent 74e40b5fe1
commit 9acc7c402f

View file

@ -34,13 +34,12 @@ options:
- Name of the service.
state:
required: false
choices: [ started, stopped, restarted, reloaded, daemon_reloaded ]
choices: [ started, stopped, restarted, reloaded ]
description:
- C(started)/C(stopped) are idempotent actions that will not run
commands unless necessary. C(restarted) will always bounce the
service. C(reloaded) will always reload. B(At least one of state
and enabled are required.)
- The C(daemon_reloaded) state was added in 2.0, it is exclusive for systemd.
sleep:
required: false
version_added: "1.3"
@ -280,7 +279,7 @@ class Service(object):
# Find ps binary
psbin = self.module.get_bin_path('ps', True)
(rc, psout, pserr) = execute_command('%s %s' % (psbin, psflags))
(rc, psout, pserr) = self.execute_command('%s %s' % (psbin, psflags))
# If rc is 0, set running as appropriate
if rc == 0:
self.running = False
@ -1414,7 +1413,7 @@ def main():
module = AnsibleModule(
argument_spec = dict(
name = dict(required=True),
state = dict(choices=['running', 'started', 'stopped', 'restarted', 'reloaded', 'daemon_reloaded']),
state = dict(choices=['running', 'started', 'stopped', 'restarted', 'reloaded']),
sleep = dict(required=False, type='int', default=None),
pattern = dict(required=False, default=None),
enabled = dict(type='bool'),
@ -1441,21 +1440,6 @@ def main():
result = {}
result['name'] = service.name
# shortcut for systemd only daemon-reloaded
if module.params['state'] == 'daemon_reloaded':
cmd = module.get_bin_path('systemctl', True)
svc_cmd = "%s %s %s" % (cmd, service.name, 'daemon-reloaded')
rc, stdout, stderr = module.run_command(svc_cmd)
result['msg']=stdout
if rc != 0:
result['rc'] = rc
if stderr:
result['msg']=stderr
module.fail_json(**result)
result['changed']=True
else:
# Find service management tools
service.get_service_tools()