mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add the possibility to restart all supervisorctl programs and groups (#3598)
* add the possibility to restart all supervisorctl programs and groups Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com> * Update changelogs/fragments/3551-supervisor-all.yml Co-authored-by: Felix Fontein <felix@fontein.de> * add info about "all" in the name parameter description Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com> * Update plugins/modules/web_infrastructure/supervisorctl.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
96de25fc94
commit
d6e14276c8
2 changed files with 10 additions and 1 deletions
3
changelogs/fragments/3551-supervisor-all.yml
Normal file
3
changelogs/fragments/3551-supervisor-all.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
minor_changes:
|
||||||
|
- supervisorctl - add the possibility to restart all programs and program groups (https://github.com/ansible-collections/community.general/issues/3551).
|
|
@ -21,6 +21,7 @@ options:
|
||||||
- The name of the supervisord program or group to manage.
|
- The name of the supervisord program or group to manage.
|
||||||
- The name will be taken as group name when it ends with a colon I(:)
|
- The name will be taken as group name when it ends with a colon I(:)
|
||||||
- Group support is only available in Ansible version 1.6 or later.
|
- Group support is only available in Ansible version 1.6 or later.
|
||||||
|
- If I(name=all), all programs and program groups will be managed.
|
||||||
required: true
|
required: true
|
||||||
config:
|
config:
|
||||||
type: path
|
type: path
|
||||||
|
@ -92,6 +93,11 @@ EXAMPLES = '''
|
||||||
name: my_app
|
name: my_app
|
||||||
state: signalled
|
state: signalled
|
||||||
signal: USR1
|
signal: USR1
|
||||||
|
|
||||||
|
- name: Restart all programs and program groups
|
||||||
|
community.general.supervisorctl:
|
||||||
|
name: all
|
||||||
|
state: restarted
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
@ -179,7 +185,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if process_name != name:
|
if process_name != name and name != "all":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
matched.append((process_name, status))
|
matched.append((process_name, status))
|
||||||
|
|
Loading…
Reference in a new issue