community.general.supervisorctl – Manage the state of a program or group of programs running via supervisord

From Get docs
Ansible/docs/2.10/collections/community/general/supervisorctl module


community.general.supervisorctl – Manage the state of a program or group of programs running via supervisord

Note

This plugin is part of the community.general collection (version 1.3.2).

To install it use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.supervisorctl.


Synopsis

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

Requirements

The below requirements are needed on the host that executes this module.

  • supervisorctl

Parameters

Parameter Choices/Defaults Comments

config

path

The supervisor configuration file path

name

string / required

The name of the supervisord program or group to manage.

The name will be taken as group name when it ends with a colon :

Group support is only available in Ansible version 1.6 or later.

password

string

password to use for authentication

server_url

string

URL on which supervisord server is listening

signal

string

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

state

string / required

  • present
  • started
  • stopped
  • restarted
  • absent
  • signalled

The desired state of program/group.

supervisorctl_path

path

path to supervisorctl executable

username

string

username to use for authentication



Notes

Note

  • When state = present, the module will call supervisorctl reread then supervisorctl add if the program/group does not exist.
  • When state = restarted, the module will call supervisorctl update then call supervisorctl restart.
  • When state = absent, the module will call supervisorctl reread then supervisorctl remove to remove the target program/group.


Examples

- name: Manage the state of program to be in started state
  community.general.supervisorctl:
    name: my_app
    state: started

- name: Manage the state of program group to be in started state
  community.general.supervisorctl:
    name: 'my_apps:'
    state: started

- 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

- 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

- name: Send a signal to my_app via supervisorctl
  community.general.supervisorctl:
    name: my_app
    state: signalled
    signal: USR1

Authors

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/supervisorctl_module.html