mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
supervisorctl: Don't try to start a starting program
Starting a "STARTING" program throws ERROR (already started), so don't do that.
This commit is contained in:
parent
7af1c96623
commit
103b5954c7
1 changed files with 2 additions and 2 deletions
|
@ -210,10 +210,10 @@ def main():
|
|||
module.fail_json(msg=out, name=name, state=state)
|
||||
|
||||
if state == 'started':
|
||||
take_action_on_processes(processes, lambda s: s != 'RUNNING', 'start', 'started')
|
||||
take_action_on_processes(processes, lambda s: s not in ('RUNNING', 'STARTING'), 'start', 'started')
|
||||
|
||||
if state == 'stopped':
|
||||
take_action_on_processes(processes, lambda s: s == 'RUNNING', 'stop', 'stopped')
|
||||
take_action_on_processes(processes, lambda s: s in ('RUNNING', 'STARTING'), 'stop', 'stopped')
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
|
|
Loading…
Reference in a new issue