Forge Home

rails

Highly configurable Rails deploys with common gem dependency management, capistrano and web server setup

11,201 downloads

9,991 latest version

2.8 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.2.0 (latest)
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0
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-rails', '0.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install deversus-rails --version 0.2.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

deversus/rails — version 0.2.0 Aug 12th 2014

rails

Highly configurable Rails deploys with common gem dependency management, capistrano and web server setup.

Overview

The goal of this module is to provide a comprehensive Rails deployment recipe that can cover a wide array of use-cases using high-level options instead of simply exposing all possible configuration details to the caller.

Optional Dependencies

  • Elasticsearch support requires elasticsearch-elasticsearch (>= 0.3.1) .

Usage

Each separate Rails application is encapsulated by rails::app.

Example

rails::app {'myapp':
    ruby_version => 'ruby-2.0.0-p0',
    db => 'mysql',
    server_name => [
        "myapp.com",
        "www.myapp.com",
        "${environment}.myapp.com",
    ],
    uses => {
        rmagick => true,
        sidekiq => true,
    },
    shared_dirs => [
        'log',
        'pids',
        'assets',
        'uploads',
        'custom_data'
    ],
}

This would set up a deploy directory for capistrano (using deversus-capistrano), a puma web service named "myapp" (using deversus-puma) and an nginx proxy for the puma service (using jfryman-nginx) with the provided $server_name hostnames. Additionally, RVM would be installed (using maestrodev-rvm) and the ruby-2.0.0-p0 environment added to it. The binary dependency packages would be installed for rmagick and mysql (e.g. libmagickwand-dev, libmysqlclient-dev ...), as well as a local redis service for sidekiq . Node.js will also be installed for the default Rails asset compilation.

Parameter Reference

app_name (namevar)

Used for default folder, directory, config file (etc) names throughout.

db

Name of the database being used - will install any binary dependencies for the client (no servers are installed).

Supported values:

  • mysql (default)
  • postgresql

Patches welcome for additional database types.

deploy_using

Which deployment strategy will be used. Currently, only capistrano is supported.

ruby_version

The ruby binary for RVM. Your system ruby will be used if this is not provided (this is the default).

server_name

The server names to pass to your server's vhosts. Must be an array of strings.

serve_using

A server or combination of servers to use to actually serve the app. These will always be automatically configured to work together.

Supported values:

  • nginx/puma (default)
  • worker-only for worker queue nodes that don't need to run a web server

Patches welcome for additional server types (nginx/unicorn? apache/passenger?).

shared_dirs

A custom set of shared directories of capistrano. See deversus-capistrano for details.

uses

A hash specifying additional dependencies and common ancillary rails services. Each key should be one of the names documented below, and its value should either be true or some additional configuration option required for that name (also documented below).

rmagick => true

Installs the ImageMagick development packages required to compile the gem.

sidekiq => true

Installs and launches a local redis service.

nokogiri => true

Installs the XML/XSLT development packages required to compile the gem.

elasticsearch => "$version"

Installs a local elasticsearch service (to use with tire et al).

yui => true

Installs the YUI compressor and its java dependencies.

Configuration Options

You must specify which version of elasticsearch to install as a string value.