Forge Home

rails

Setup of a rails environment for capistrano deployment, using initforthe-capistrano.

11,098 downloads

2,113 latest version

5.0 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.4.9 (latest)
  • 0.4.8
  • 0.4.7
  • 0.4.6
  • 0.4.4
  • 0.4.3
  • 0.4.2
  • 0.4.0
  • 0.3.0
  • 0.2.3
  • 0.2.2
  • 0.2.0
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
released Feb 28th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • ,

Start using this module

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

Add this module to your Puppetfile:

mod 'initforthe-rails', '0.4.9'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install initforthe-rails --version 0.4.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

Documentation

initforthe/rails — version 0.4.9 Feb 28th 2020

rails

Table of Contents

  1. Description
  2. Setup - The basics of getting started with rails
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

This module sets up a rails app ready for deployment via capistrano.

It assumes environment variables are loaded via dotenv-rails or similar.

Setup

Beginning with rails

The most simple usage is as follows:

include rails

rails::app { 'my_app': }

This will create a capistrano deployment in /var/www/my_app and put environment variables in /etc/defaults/my_app.

Usage

Configure all rails deployments

class { 'rails':
  user        => 'deploy',
  deploy_root => '/srv/apps',
}

Set up a rails app

rails::app { 'my_app':
  env => {
    'RAILS_ENV'       => 'staging',
    'SECRET_KEY_BASE' => '1234567890',
  }
}

Reference

Classes:

Defined Types:

Classes

rails

Sets up the root for all rails app deployments. Set the following parameters if you want something other than the default settings:

user

Which user you want to own the deployments. The user must exist already. Default: root

deploy_root

The root for your deployments. Default: /var/www

Defined Types

rails::app

Sets up a deployment for a single app. Set the following parameters if you want something other than the default settings:

app_environment

The environment the application should run under. Default: production

db_opts

A hash of options to be passed to the database.yml config file.

env_vars

A hash of environment variables to set for the app. Default: {}

Limitations

This module has only been tested on Debian-based OSes. YMMV with others.

Development

Please follow the guidance for contributing on the Puppet Forge

Getting things going

$ bundle install
$ gem install pdk

Testing

$ pdk test unit

Publishing (from master only)

Make sure everything is committed and pushed to master first. Direct changes to master should not be made.

For a minor version bump:

$ bundle exec rake module:release

For anything else:

$ bundle exec rake module:clean module:bump_commit:TYPE module:tag
$ git push && git push --tags

Details of type can be found by running rake -T