GithubHelp home page GithubHelp logo

isabella232 / ansible-supervisor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zapier/ansible-supervisor

0.0 0.0 0.0 31 KB

Ansible role to set up (the latest or a specific version of) supervisor in Ubuntu systems

License: MIT License

Shell 100.00%

ansible-supervisor's Introduction

supervisor

Build Status Ansible Galaxy

Set up the latest or a specific version of supervisor in Ubuntu systems.

Requirements

  • pip (will not installed)

  • python (will be installed)

Variables

  • supervisor_version [default: latest]: Supervisor version to install (e.g. latest, 3.1.3)

  • supervisor_unix_http_server_file [default: /var/run/supervisor.sock]: A path to a UNIX domain socket (e.g. /tmp/supervisord.sock) on which supervisor will listen for HTTP/XML-RPC requests. supervisorctl uses XML-RPC to communicate with supervisord over this port

  • supervisor_unix_http_server_chmod [default: '0700']: Change the UNIX permission mode bits of the UNIX domain socket to this value at startup

  • supervisor_inet_http_server_enabled [default: false]: Whether or not to enable the HTTP server

  • supervisor_inet_http_server_port [default: 9001]: A TCP host:port value or (e.g. 127.0.0.1:9001) on which supervisor will listen for HTTP/XML-RPC requests. supervisorctl will use XML-RPC to communicate with supervisord over this port

  • supervisor_inet_http_server_username [default: admin]: The username required for authentication to this HTTP server Make sure to change!

  • supervisor_inet_http_server_password [default: '4ubA&Et=ASPe']: The password required for authentication to this HTTP server. This can be a cleartext password, or can be specified as a SHA-1 hash if prefixed by the string {SHA} Make sure to change!

  • supervisor_supervisord_logfile [default: /var/log/supervisor/supervisord.log]: The path to the activity log of the supervisord process

  • supervisor_supervisord_pidfile [default: /var/run/supervisord.pid]: The location in which supervisord keeps its pid file

  • supervisor_supervisord_childlogdir [default: /var/log/supervisor]: The directory used for AUTO child log files

  • supervisor_supervisorctl_serverurl [default: "unix://{{ supervisor_unix_http_server_file }}"]: The URL that should be used to access the supervisord server, e.g. http://localhost:9001. For UNIX domain sockets, use unix:///absolute/path/to/file.sock

  • supervisor_include [default: '/etc/supervisor/conf.d/*.conf']: A (single) absolute file glob of files to include

  • supervisor_programs_present [default: {}, see templates/etc/supervisor/conf.d/program.conf.j2]: Program definitions

  • supervisor_programs_present.{n} [required]: Program name

  • supervisor_programs_present.{n}.command [required]: The command that will be run when this program is started

  • supervisor_programs_present.{n}.directory [optional]: A directory to which supervisord should temporarily chdir before exec’ing the child

  • supervisor_programs_present.{n}.environment [optional]: A list of key/value pairs that will be placed in the child process’ environment

  • supervisor_programs_present.{n}.autostart [optional]: If true, this program will start automatically when supervisord is started

  • supervisor_programs_present.{n}.autorestart [optional]: Whether the process will be autorestarted

  • supervisor_programs_present.{n}.startretries [optional]: The number of serial failure attempts that supervisord will allow when attempting to start the program before giving up

  • supervisor_programs_present.{n}.stdout_logfile [optional]: Put process stdout output in this file

  • supervisor_programs_present.{n}.stdout_logfile_maxbytes [optional]: The maximum number of bytes that may be consumed by stdout_logfile before it is rotated

  • supervisor_programs_present.{n}.stderr_logfile [optional]: Put process stderr output in this file

  • supervisor_programs_present.{n}.stderr_logfile_maxbytes [optional]: The maximum number of bytes before logfile rotation for stderr_logfile

  • supervisor_programs_present.{n}.user [optional]: This UNIX user account will be used as the account which runs the program

  • supervisor_programs_present.{n}.numprocs [optional]: Supervisor will start as many instances of this program as named by numprocs

  • supervisor_programs_present.{n}.process_name [optional]: Process name, defaults to %(program_name)s-%(process_num)s when numprocs > 1

  • supervisor_programs_absent [default: {}]: Program definitions (to be removed)

  • supervisor_groups_present [default: {}, see templates/etc/supervisor/conf.d/group.conf.j2]: Group definitions

  • supervisor_groups_present.{n} [required]: Group name

  • supervisor_groups_present.{n}.programs [required]: List of programs

  • supervisor_groups_present.{n}.priority [optional]: A priority number

  • supervisor_groups_absent [default: {}]: Group definitions (to be removed)

Dependencies

None

Recommended

  • ansible-pip (see)

Example

---
- hosts: all
  roles:
    - supervisor
Adding two programs in one group
supervisor_programs_present:
  foo:
    command: 'sleep 10'
    directory: /tmp
    autostart: true
    autorestart: true
    startretries: 3
    stdout_logfile: /tmp/foo.out
    stdout_logfile_maxbytes: 0
    stderr_logfile: /tmp/foo.err
    stderr_logfile_maxbytes: 0
    user: vagrant
    numprocs: 8
    process_name: %(program_name)s-%(process_num)s
  bar:
    command: 'sleep 10'
    directory: /tmp
    autostart: true
    autorestart: true
    startretries: 3
    stdout_logfile: /tmp/bar.out
    stdout_logfile_maxbytes: 0
    stderr_logfile: /tmp/bar.err
    stderr_logfile_maxbytes: 0
    user: vboxadd

supervisor_groups_present:
  foo-and-bar:
    programs:
      - foo
      - bar
    priority: 10
Removing a group
supervisor_groups_absent:
  foo-and-bar: {}

License

MIT

Author Information

Mischa ter Smitten

Feedback, bug-reports, requests, ...

Are welcome!

ansible-supervisor's People

Contributors

mvdriel avatar tersmitten avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.