�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d d
l Z d d l
m Z m Z d � Z
e d
k r� e
� n d
S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bysi
---
module: supervisorctl
short_description: Manage the state of a program or group of programs running via supervisord
description:
- Manage the state of a program or group of programs running via supervisord
version_added: "0.7"
options:
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 I(:)
- Group support is only available in Ansible version 1.6 or later.
required: true
config:
description:
- The supervisor configuration file path
version_added: "1.3"
server_url:
description:
- URL on which supervisord server is listening
version_added: "1.3"
username:
description:
- username to use for authentication
version_added: "1.3"
password:
description:
- password to use for authentication
version_added: "1.3"
state:
description:
- The desired state of program/group.
required: true
choices: [ "present", "started", "stopped", "restarted", "absent", "signalled" ]
signal:
description:
- The signal to send to the program/group, when combined with the 'signalled' state. Required when l(state=signalled).
version_added: "2.8"
supervisorctl_path:
description:
- path to supervisorctl executable
version_added: "1.4"
notes:
- When C(state) = I(present), the module will call C(supervisorctl reread) then C(supervisorctl add) if the program/group does not exist.
- When C(state) = I(restarted), the module will call C(supervisorctl update) then call C(supervisorctl restart).
- When C(state) = I(absent), the module will call C(supervisorctl reread) then C(supervisorctl remove) to remove the target program/group.
requirements: [ "supervisorctl" ]
author:
- "Matt Wright (@mattupstate)"
- "Aaron Wang (@inetfuture) <[email protected]>"
s�
# Manage the state of program to be in 'started' state.
- supervisorctl:
name: my_app
state: started
# Manage the state of program group to be in 'started' state.
- supervisorctl:
name: 'my_apps:'
state: started
# Restart my_app, reading supervisorctl configuration from a specified file.
- supervisorctl:
name: my_app
state: restarted
config: /var/opt/my_project/supervisord.conf
# Restart my_app, connecting to supervisord with credentials and server URL.
- supervisorctl:
name: my_app
state: restarted
username: test
password: testpass
server_url: http://localhost:9001
# Send a signal to my_app via supervisorctl
- supervisorctl:
name: my_app
state: signalled
signal: USR1
N( t
AnsibleModulet
is_executablec
` s� t d t d t � d t d t d d � d t d t � d t d t � d t d t d t � d
t d t d d � d t d t d d
d d d d d g � d t d t � � } t d | d t � � � j d � t � � j d � r� t � � j d � � n � j d � � j j d � } � j j d � } � j j d � } � j j d � } � j j d
� } � j j d � } t d d d d d d d d � � _ | r�t j
j | � r�t | � r�| g � q�� j
d d | � n � j d t � g � | r� j d | g � n | r+� j d | g � n | rG� j d! | g � n | rc� j d"