Documentation
PLEASE NOTE: This document applies to latest version and not to the latest stable release v2.21
Documentation for other releases can be found by using the version selector in the top right of any doc page.supervisor
Manage Supervisor process control daemon programs.
Attributes
check_mode:
support: full
Parameters
| Parameter | Required | Type | Values | Description |
|---|---|---|---|---|
| name | true | string | Program name to manage. | |
| command | string | Command to run for the program. | ||
| state | string | reloaded restarted started stopped |
State of the program. | |
| enabled | boolean | Whether the program should be enabled (have a config file) or not. | ||
| user | string | User to run the program as. | ||
| autostart | boolean | Whether the program should auto-start with supervisord. | ||
| autorestart | string | True False Unexpected |
Whether the program should auto-restart on exit. | |
| stdout_logfile | string | Path to stdout log file. | ||
| stderr_logfile | string | Path to stderr log file. | ||
| environment | object | Environment variables for the program. | ||
| config_dir | string | Path to supervisor config directory. |
Example
- name: Start myapp program
supervisor:
name: myapp
state: started
- name: Stop myapp program
supervisor:
name: myapp
state: stopped
- name: Restart myapp program
supervisor:
name: myapp
state: restarted
- name: Enable myapp program with command
supervisor:
name: myapp
command: /usr/bin/myapp --port 8080
state: started
enabled: true
user: appuser
autostart: true
autorestart: true
stdout_logfile: /var/log/myapp stdout.log
stderr_logfile: /var/log/myapp stderr.log
- name: Disable myapp program
supervisor:
name: myapp
enabled: false
- name: Start myapp with environment variables
supervisor:
name: myapp
command: /usr/bin/myapp
state: started
environment:
PORT: "8080"
NODE_ENV: production