Check if a service exists
This commit is contained in:
parent
ccfc9d2f6b
commit
361a1e1b65
1 changed files with 6 additions and 1 deletions
|
@ -192,9 +192,14 @@ def main():
|
|||
if state == 'restarted':
|
||||
rc, out, err = run_supervisorctl('update')
|
||||
processes = get_matched_processes()
|
||||
if not processes:
|
||||
module.fail_json(name=name, msg="ERROR (no such process)")
|
||||
|
||||
take_action_on_processes(processes, lambda s: True, 'restart', 'started')
|
||||
|
||||
processes = get_matched_processes()
|
||||
if not processes:
|
||||
module.fail_json(name=name, msg="ERROR (no such process)")
|
||||
|
||||
if state == 'present':
|
||||
if len(processes) > 0:
|
||||
|
|
Loading…
Reference in a new issue