Repository: ansible-collections/community.general

Issue:
supervisorctl can't restart all 
### Summary

supervisorctl can't restart all 

see also https://github.com/ansible/ansible/issues/67838



### Issue Type

Bug Report

### Component Name

supervisorctl

### Ansible Version

```console (paste below)
$ ansible --version
ansible 2.9.25
```

### Community.general Version

```console (paste below)
$ ansible-galaxy collection list community.general
usage: ansible-galaxy collection [-h] COLLECTION_ACTION ...
ansible-galaxy collection: error: argument COLLECTION_ACTION: invalid choice: 'list' (choose from 'init', 'build', 'publish', 'install')
```


### Configuration

_No response_

### OS / Environment

I am on MacOS and my servers are Ubuntu 18

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
- name: Restart Supervisor processes
  supervisorctl: name=all state=restarted
```


### Expected Results

same as running the `supervisoctl restart all` command: restart all programs

I also tried with `"*"` instead of `all`

### Actual Results

raises

```
fatal: [192.168.1.88]: FAILED! => changed=false
  msg: ERROR (no such process)
  name: all
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/web_infrastructure/supervisorctl.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/web_infrastructure/supervisorctl.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @inetfuture @mattupstate
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->
I don't see that the documentation says that the module can restart everything, so I don't think this is a bug, but a feature request.
I believe it's actually supported, http://supervisord.org/running.html#supervisorctl-actions:
```
restart all

Restart all processes Note: restart does not reread config files. For that, see reread and update.
```

Resolving patch:
diff --git a/plugins/modules/web_infrastructure/supervisorctl.py b/plugins/modules/web_infrastructure/supervisorctl.py
--- a/plugins/modules/web_infrastructure/supervisorctl.py
+++ b/plugins/modules/web_infrastructure/supervisorctl.py
@@ -21,6 +21,7 @@
       - 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 @@
     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 get_matched_processes():
                 else:
                     continue
             else:
-                if process_name != name:
+                if process_name != name and name != "all":
                     continue
 
             matched.append((process_name, status))


Test patch: