Forge Home

puma

Configure puma servers for Ruby-on-Rails apps

11,461 downloads

10,091 latest version

3.1 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.1.9 (latest)
  • 0.1.7
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
released Aug 12th 2014
This version is compatible with:
  • Debian, Ubuntu

Start using this module

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

Add this module to your Puppetfile:

mod 'deversus-puma', '0.1.9'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add deversus-puma
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install deversus-puma --version 0.1.9

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
Tags: ruby, rails, nginx, rvm, puma

Documentation

deversus/puma — version 0.1.9 Aug 12th 2014

puma

Overview

Configure puma servers for Ruby-on-Rails apps.

Installs the application as a system service (using upstart or good old sysv - upstart has the benefit of not requiring a supervisor for restarting rails).

Configurations for Debian-family systems included, patches welcome for other OSes.

For a more comprehensive Rails deployment recipe which makes use of this module, see deversus-rails.

Optional Dependencies

  • RVM support requires maestrodev-rvm (~> v1.5.5) .
  • NGINX support requires jfryman-nginx (~> v0.0.9).

Patches welcome for servers other than NGINX.

Usage

# Debian default values shown (except rvm, which defaults to false)
puma::app {'myapp':
    app_name           => 'myapp',
    app_root           => '/var/www/myapp/current',
    puma_user          => 'puma',
    www_user           => 'www-data',
    min_threads        => 1,
    max_threads        => 16,
    workers            => 1
    init_active_record => false,
    preload_app        => true,
    rails_env          => 'production',
    rvm_ruby           => 'ruby-2.0.0-p0,
}

This would install a service called myapp (in /etc/init if upstart is used, /etc/init.d otherwise). Socket and PID files will be put in /var/run/myapp/. Log files will be put in /var/log/myapp.puma.stdout.log etc.

An RVM ruby environment for ruby-2.0.0-p0 will be installed if needed and used to launch puma. (with rvm_ruby => false, system ruby will be used)

Configuring NGINX

A convenience resource for configuring NGINX for the above setup is provided:

# Debian default values shown
puma::nginxconfig {'myapp':
    server_name     => ['www.myapp.com'],
    public_root     => '/var/www/myapp/current/public',
}

This will create the necessary NGINX vhost and location configurations to serve a puma rails app.