simpleweb/ansible-unicorn-rvm

Name: ansible-unicorn-rvm

Owner: Simpleweb

Description: Ansible Unicorn installation with RVM and multiple application support

Forked from: agios/ansible-unicorn-rvm

Created: 2015-06-16 10:39:32.0

Updated: 2015-11-16 00:07:53.0

Pushed: 2015-11-20 14:35:06.0

Homepage:

Size: 15

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Ansible Unicorn/RVM setup

This Ansible role installs a service for Unicorn, with RVM and multiple application support

Requirements

Expects rvm to be installed system-wide

Role Variables
Example Playbook

The role could be included in a playbook as follows:


ts: application
les:
- role: unicorn-rvm
  rails_apps:
    - { name: 'my_app1', ruby_version: 'ruby-1.9.3' }
    - { name: 'my_app2', ruby_version: 'ruby-2.1.1', root: '/var/test_apps/app2', env: staging }
    - name: 'my_app3'
      ruby_version: 'ruby-2.1.1'
      db:
        password: topsecret
      secrets:
        secret_key_base: SuperSecretHexString

If the init script is called without any config parameters, it will attempt to run the init command for all unicorn configurations listed in /etc/unicorn/*.conf

/etc/init.d/unicorn start # starts all unicorns

If you specify a particular config, it will only operate on that one

/etc/init.d/unicorn start my_app

Notes

This role does not deploy the actual application, it assumes that this will be done in another role or using a deployment tool such as Capistrano.

However you deploy, keep in mind that this setup expects each application to use an rvm gemset with the name of the application.

So for example, for a Capistrano 3 deployment of an app called 'my_app' under ruby 2.1.1, you should require 'capistrano/rvm' and set the following in your Capistrano configuration:

set :rvm_ruby_version, '2.1.1@my_app'

If you use this role to generate database.yml and secrets.yml, it is advised to store the keys in an ansible vault file

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.