Forge Home

supervisord

supervisord class and functions

982,806 downloads

714,848 latest version

3.4 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.6.1 (latest)
  • 0.6.0
  • 0.5.2
  • 0.5.1
  • 0.5.0
  • 0.4.2
  • 0.4.1
  • 0.4.0
  • 0.3.3
  • 0.3.2
  • 0.3.1
  • 0.3.0
  • 0.2.3
  • 0.2.2
  • 0.2.1
  • 0.2.0
  • 0.1.0
released Dec 3rd 2014

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'ajcrowe-supervisord', '0.5.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ajcrowe-supervisord
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ajcrowe-supervisord --version 0.5.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

ajcrowe/supervisord — version 0.5.0 Dec 3rd 2014

Puppet Supervisord

Puppet Forge Build Status

Puppet module to manage the supervisord process control system.

Functions available to configure

Examples

Configuring supervisord with defaults

Install supervisord with pip and install an init script if available

include ::supervisord

Install supervisord and pip

Install supervisord and install pip if not available.

class { 'supervisord':
  install_pip => true,
}

This will download setuptool and install pip with easy_install.

You can pass a specific url with $setuptools_url = 'url'

Install without pip

If you want to use your system package manager you can specify that with supervisord::package_provider.

You'll also likely need to adjust the supervisord::service_name to match that installed by the system package. If you're using Debian or Redhat OS families you'll also want to disable the init scripts with supervisord::install_init = false.

Note: Only Debian and RedHat families have an init script currently.

Configure a program

supervisord::program { 'myprogram':
  command     => 'command --args',
  priority    => '100',
  environment => {
    'HOME'   => '/home/myuser',
    'PATH'   => '/bin:/sbin:/usr/bin:/usr/sbin',
    'SECRET' => 'mysecret'
  }
}

You may also specify a variable for a hiera lookup to retreive your environment hash. This allows you to reuse existing environment variable hashes.

supervisord::program { 'myprogram':
  command  => 'command --args',
  priority => '100',
  env_var  => 'my_common_envs'
}

Or you can fully define your programs in hiera:

supervisord::programs:
  'myprogram':
    command: 'command --args'
    autostart: yes
    autorestart: 'true'
    environment:
      HOME: '/home/myuser'
      PATH: '/bin:/sbin:/usr/bin:/usr/sbin'
      SECRET: 'mysecret'

Configure a group

supervisord::group { 'mygroup':
  priority => 100,
  programs => ['program1', 'program2', 'program3']
}

Configure a ctlplugin

supervisord::ctlplugin { 'laforge':
  ctl_factory => 'mr.laforge.controllerplugin:make_laforge_controllerplugin'
}

Configure an eventlistener

supervisord::eventlistener { 'mylistener':
  command  => 'command --args',
  events   => ['PROCESS_STATE', 'PROCESS_STATE_START']
  priority => '100',
  env_var  => 'my_common_envs'
}

Configure an rpcinterface

supervisord::rpcinterface { 'laforge':
  rpcinterface_factory => 'mr.laforge.rpcinterface:make_laforge_rpcinterface'
}

Run supervisorctl Commands

Should you need to run a sequence of command with supervisorctl you can use the define type supervisord::supervisorctl

supervisord::supervisorctl { 'restart_myapp':
  command => 'restart',
  process => 'myapp'
}

You can also issue a command without specifying a process.

Development

If you have suggestions or improvements please file an issue or pull request, i'll try and sort them as quickly as possble.

If you submit a pull please try and include tests for the new functionality/fix. The module is tested with Travis-CI.

Credits