entanet_devops.supervisor
Supervisor
This is set up to install Supervisor and allow you to fully control its configuration.
Note: This has only been tested on Ubuntu 18.04.
Role Variables
- supervisor_disable (Default: True) 
- artisan_template: Location of the template for artisan commands (Default is role template) 
- raw_template: Location of the template for raw commands (Default is role template) 
- supervisor_command_user: The default user for running commands 
- supervisor_command_numprocs: The default number of processes to run for a command 
- app_directory: Where the artisan app is installed Also, where you can find supervisor/supervisor_commands.yml 
Commands can be set in the supervisor_commands variable from the included supervisor_commands.yml or default_vars.
Simple Example:
File: supervisor_commands.yml:
artisan_commands:
  - my:artisan_cmd
  - my:artisan_cmd2
  - my:artisan_cmd3
raw_commands:
  - /full/path/to/my/cmd
Example with Overrides in Role Group Vars:
(Note: Override variables blend with those from supervisor_commands.yml)
File: group_vars/all/main.yml:
artisan_commands_override:
  - cmd: artisan_cmd2
    user: myuser
    numprocs: 4
raw_commands_override:
  - /additional/path/of/thing/to/run
File: supervisor_commands.yml (remains unchanged):
artisan_commands:
  - my:artisan_cmd
  - my:artisan_cmd2
  - my:artisan_cmd3
raw_commands:
  - /full/path/to/my/cmd
Example with User/Numproc Overrides in supervisor_commands.yml:
(Note: List items can be plain text or a map)
File: supervisor_commands.yml:
artisan_commands:
  - my:artisan_cmd
  - cmd: my:artisan_cmd2
    user: myuser
    numprocs: 3
  - cmd: my:artisan_cmd3
    numproc: 2
Disables Supervisor on Boot
Example Playbook
- hosts: servers
  roles:
    - entanet-devops.supervisor
ansible-galaxy install entanet_devops.supervisor