diff --git a/changelogs/fragments/3551-supervisor-all.yml b/changelogs/fragments/3551-supervisor-all.yml new file mode 100644 index 0000000000..09d940b7e9 --- /dev/null +++ b/changelogs/fragments/3551-supervisor-all.yml @@ -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). diff --git a/plugins/modules/web_infrastructure/supervisorctl.py b/plugins/modules/web_infrastructure/supervisorctl.py index f44af0befe..bc4ef19af1 100644 --- a/plugins/modules/web_infrastructure/supervisorctl.py +++ b/plugins/modules/web_infrastructure/supervisorctl.py @@ -21,6 +21,7 @@ options: - 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(:) - 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 config: type: path @@ -92,6 +93,11 @@ EXAMPLES = ''' name: my_app state: signalled signal: USR1 + +- name: Restart all programs and program groups + community.general.supervisorctl: + name: all + state: restarted ''' import os @@ -179,7 +185,7 @@ def main(): else: continue else: - if process_name != name: + if process_name != name and name != "all": continue matched.append((process_name, status))