|
|
@ -116,9 +116,9 @@ def main():
|
|
|
|
elif state == 'restarted':
|
|
|
|
elif state == 'restarted':
|
|
|
|
if module.check_mode:
|
|
|
|
if module.check_mode:
|
|
|
|
module.exit_json(changed=True)
|
|
|
|
module.exit_json(changed=True)
|
|
|
|
module.run_command('%s stop %s' % (MONIT, name))
|
|
|
|
module.run_command('%s restart %s' % (MONIT, name))
|
|
|
|
rc, out, err = module.run_command('%s start %s' % (MONIT, name))
|
|
|
|
rc, out, err = module.run_command('%s summary | grep %s' % (MONIT, name))
|
|
|
|
if 'initializing' in out or 'start pending' in out:
|
|
|
|
if 'initializing' in out or 'restart pending' in out:
|
|
|
|
module.exit_json(changed=True, name=name, state=state)
|
|
|
|
module.exit_json(changed=True, name=name, state=state)
|
|
|
|
module.fail_json(msg=out)
|
|
|
|
module.fail_json(msg=out)
|
|
|
|
|
|
|
|
|
|
|
|