community.general.supervisorctl (8.5.0) — module

Manage the state of a program or group of programs running via supervisord

Authors: Matt Wright (@mattupstate), Aaron Wang (@inetfuture) <inetfuture@gmail.com>

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manage the state of a program or group of programs running via supervisord


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Manage the state of program to be in started state
  community.general.supervisorctl:
    name: my_app
    state: started
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Manage the state of program group to be in started state
  community.general.supervisorctl:
    name: 'my_apps:'
    state: started
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Restart my_app, reading supervisorctl configuration from a specified file
  community.general.supervisorctl:
    name: my_app
    state: restarted
    config: /var/opt/my_project/supervisord.conf
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Restart my_app, connecting to supervisord with credentials and server URL
  community.general.supervisorctl:
    name: my_app
    state: restarted
    username: test
    password: testpass
    server_url: http://localhost:9001
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Send a signal to my_app via supervisorctl
  community.general.supervisorctl:
    name: my_app
    state: signalled
    signal: USR1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Restart all programs and program groups
  community.general.supervisorctl:
    name: all
    state: restarted

Inputs

    
name:
    description:
    - The name of the supervisord program or group to manage.
    - The name will be taken as group name when it ends with a colon V(:).
    - If O(name=all), all programs and program groups will be managed.
    required: true
    type: str

state:
    choices:
    - present
    - started
    - stopped
    - restarted
    - absent
    - signalled
    description:
    - The desired state of program/group.
    required: true
    type: str

config:
    description:
    - The supervisor configuration file path
    type: path

signal:
    description:
    - The signal to send to the program/group, when combined with the 'signalled' state.
      Required when l(state=signalled).
    type: str

password:
    description:
    - password to use for authentication
    type: str

username:
    description:
    - username to use for authentication
    type: str

server_url:
    description:
    - URL on which supervisord server is listening
    type: str

supervisorctl_path:
    description:
    - path to supervisorctl executable
    type: path

stop_before_removing:
    default: false
    description:
    - Use O(stop_before_removing=true) to stop the program/group before removing it
    required: false
    type: bool
    version_added: 7.5.0
    version_added_collection: community.general