jebovic.supervisor

Supervisor

Build-Status Ansible Galaxy

Installieren und Konfigurieren von Supervisor. Sie können Ihre eigenen Programme mit YAML-Variablen hinzufügen.

Diese Rolle ist Teil meines OPS-Projekts. Folgen Sie diesem Link, um es in Aktion zu sehen. OPS bietet viele Dinge, wie eine Vagrant-Datei für Entwicklungs-VMs, Playbooks für Rollensynchronisierung, Inventardateien, Beispiele zur Konfiguration von Rollen, Konfigurationsdateien für Ansible und vieles mehr.

Kompatibilität

Getestet und genehmigt auf:

  • Debian jessie (8+)
  • Ubuntu Trusty (14.04 LTS)
  • Ubuntu Xenial (16.04 LTS)

Rollenvariablen

# Supervisor Installationskonfiguration
supervisor_packages:
  - supervisor
supervisor_pip_packages:
  - superlance

# Grundkonfiguration des Supervisors
supervisor_user: root
supervisor_socket: /tmp/supervisor.sock
supervisor_pidfile: /var/run/supervisord.pid
supervisor_log_path: /var/log/supervisord
supervisor_log_file: "{{ supervisor_log_path }}/supervisord.log"
supervisor_http_host: "{{ ansible_host }}"
supervisor_http_port: 9988
supervisor_http_username: supervisor_user
supervisor_http_password: supervisor

# Supervisor-Programme
supervisor_programs: []

# Supervisor-Events
supervisor_events: []

Beispiel-Playbook

- hosts: servers
  roles:
     - { role: jebovic.supervisor }

Beispiel: Konfiguration

# Supervisor UI IP & Port-Bindung
supervisor_user: supervisor
supervisor_http_host: 127.0.0.1
supervisor_http_port: 9988
# Konfiguration der Supervisor-Programme
supervisor_programs:
  traefik:
    command: "{{ traefik_bin_path }} -c {{ traefik_config_dir }}/traefik.toml"
    autostart: "true"
    autorestart: "true"
    stderr_logfile: "{{ supervisor_log_path }}/traefik-stderr.log"
    stderr_logfile_maxbytes: 1MB
    stderr_logfile_backups: 10
    stdout_logfile: "{{ supervisor_log_path }}/traefik-stdout.log"
    stdout_logfile_maxbytes: 1MB
    stdout_logfile_backups: 10
    user: root
  consul:
    command: "{{ consul_bin_path }} agent -ui -bind={{ ansible_host }} -client=0.0.0.0 -node={{ ansible_fqdn }} -bootstrap -server -http-port {{ consul_http_port }} -data-dir={{ consul_data_dir }} -config-dir={{ consul_config_dir }} -domain={{ ansible_fqdn }}."
    autostart: "true"
    autorestart: "true"
    stderr_logfile: "{{ supervisor_log_path }}/consul-stderr.log"
    stderr_logfile_maxbytes: 1MB
    stderr_logfile_backups: 10
    stdout_logfile: "{{ supervisor_log_path }}/consul-stdout.log"
    stdout_logfile_maxbytes: 1MB
    stdout_logfile_backups: 10
    user: root
  mailhog:
    command: /usr/local/bin/mailhog -api-bind-addr :8025 -ui-bind-addr :8025
    autostart: "true"
    autorestart: "true"
    stderr_logfile: "{{ supervisor_log_path }}/mailhog-stderr.log"
    user: www-data

# Konfiguration der Supervisor-Events (abhängig von der Installation des Superlance-Plugins)
supervisor_events:
  httpok:
    command: httpok -p mailhog http://localhost:8025
    events: TICK_60

Tags

  • supervisor_config : nur Konfiguration aktualisieren und Dienst neu starten

Lizenz

MIT

Autoreninformationen

Jérémy Baumgarth https://github.com/jebovic

Über das Projekt

Install and configure supervisor, you can add your own programs with yaml variables

Installieren
ansible-galaxy install jebovic.supervisor
GitHub Repository
Lizenz
mit
Downloads
2.8k