Skip to content

applewiskey/puppet-supervisor

 
 

Repository files navigation

puppet-supervisor

Wirbelsturm-compatible Puppet module to deploy supervisord version 3.0+.

You can use this Puppet module to deploy supervisord to physical and virtual machines, for instance via your existing internal or cloud-based Puppet infrastructure and via a tool such as Vagrant for local and remote deployments.

Also, you can use this Puppet module to run services such as Apache ZooKeeper under process supervision via supervisord. See puppet-zookeeper for an example.


Table of Contents


Quick start

See section Usage below.

Features

  • Decouples code (Puppet manifests) from configuration data (Hiera) through the use of Puppet parameterized classes, i.e. class parameters. Hence you should use Hiera to control how supervisord is deployed and to which machines.
  • Supports RHEL OS family (e.g. RHEL 6, CentOS 6, Amazon Linux) as well as the Debian/Ubuntu family. However our own usage and testing are almost exclusively done on the RHEL family.
    • Code contributions to support additional OS families are welcome!

Requirements and assumptions

  • This module requires that the target machines to which you are deploying supervisord have yum repositories configured for pulling the supervisord 3.0+ package (i.e. RPM).
    • Note: The supervisord version in EPEL6 is the outdated 2.x version, which is not supported by this module.
    • We provide wirbelsturm-rpm-supervisord so that you can conveniently build such an RPM yourself.
  • This module has primarily been tested on the RHEL OS family.

Installation

It is recommended to use librarian-puppet to add this module to your Puppet setup.

Add the following lines to your Puppetfile:

# Add the stdlib dependency as hosted on public Puppet Forge.
#
# We intentionally do not include the stdlib dependency in our Modulefile to make it easier for users who decided to
# use internal copies of stdlib so that their deployments are not coupled to the availability of PuppetForge.  While
# there are tools such as puppet-library for hosting internal forges or for proxying to the public forge, not everyone
# is actually using those tools.
mod 'puppetlabs/stdlib'

mod 'supervisor',
  :git => 'https://github.com/miguno/puppet-supervisor.git'

Then use librarian-puppet to install (or update) the Puppet module.

Configuration

  • See init.pp for the list of currently supported configuration parameters. These should be self-explanatory.
  • See params.pp for the default values of those configuration parameters.

Usage

IMPORTANT: Make sure you read and follow the Requirements and assumptions section above. Otherwise the examples below will of course not work.

Configuration examples

Using Hiera

Simple example, using default settings.

---
classes:
  - supervisor

More sophisticated example that overrides some of the default settings:

---
classes:
  - supervisor

supervisor::logfile_maxbytes: '20MB'
supervisor::logfile_backups: 5

Using Puppet manifests

Note: It is recommended to use Hiera to control deployments instead of using this module in your Puppet manifests directly.

TBD

Service management

To manually start, stop, restart, or check the status of a managed service, respectively:

$ sudo supervisorctl [start|stop|restart|status] <service-name>

Example:

$ sudo supervisorctl status zookeeper
zookeeper                        RUNNING    pid 16461, uptime 2 days, 22:41:21

Log files

  • Supervisord main log file: /var/log/supervisor/supervisord.log
  • Supervisord log files related to managed processes:
    • /var/log/supervisor/<service-name>/<service-name>.out*
    • /var/log/supervisor/<service-name>/<service-name>.err*

TODO

  • Code clean up to ensure consistent code style and following Puppet best practices. For instance, init.pp has code that should rather belong into install.pp.
  • Add more unit tests and specs.
  • Add Travis CI setup.
  • Add rollback/remove functionality to complete purge Supervisord related packages and configuration files from a machine.

Change log

See CHANGELOG.

Contributing to puppet-supervisor

Code contributions, bug reports, feature requests etc. are all welcome.

If you are new to GitHub please read Contributing to a project for how to send patches and pull requests to puppet-supervisor.

Credits

This module is based on -- and a fork of a fork of -- the great work done by plathrop and mhahn (which itself is a fork of plathrop).

License

Copyright © 2013-2014 Michael G. Noll

The original license of plathrop is a custom license and lists a copyright 2010 of Digg, Inc. An archived version of this original license is available at ORIGINAL_LICENSE.

As far as any changes introduced by this fork are concerned (as applicable and compatible with the original license) the LICENSE is used.

Note: If you are the initial creator of this module and have concerns about the licensing please do contact me!

About

Puppet module for configuring the supervisor daemon tool.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Puppet 77.6%
  • HTML 22.3%
  • Pascal 0.1%