Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


opsworks_ruby (45) Versions 0.1.0

Set of chef recipes for OpsWorks based Ruby projects

cookbook 'opsworks_ruby', '= 0.1.0', :supermarket
cookbook 'opsworks_ruby', '= 0.1.0'
knife supermarket install opsworks_ruby
knife supermarket download opsworks_ruby
Quality 100%

opsworks_ruby Cookbook

Build Status
Coverage Status

A chef cookbook to deploy Ruby applications to Amazon OpsWorks.

Quick Start

This cookbook is design to "just work". So in base case scenario, all you have
to do is create a layer and application with assigned RDS data source, then
add recipes to the corresponding OpsWorks actions.

Currently only PostgreSQL database, GIT SCM, Rails framework, Unicorn
appserver and nginx webserver are supported.
New drivers will be added soon.




Currenty this cookbook was tested only under Ubuntu 14.04, more platforms will
be added soon. However, other Debian family distributions are assumed to work.


Attributes format follows the guidelines of old Chef 11.x based OpsWorks stack.
So all of them, need to be placed under node['deploy'][<application_shortname>].
Attributes (and whole logic of this cookbook) are divided to six sections.
Following convention is used: app == node['deploy'][<application_shortname>]
so for example app['framework']['adapter'] actually means


  • node['applications']
    • An array of application shortnames which should be deployed to given layer. If not provided, all detected applications will be deployed.


Those parameters will be passed without any alteration to the database.yml
file. Keep in mind, that if you have RDS connected to your OpsWorks application,
you don't need to use them. The chef will do all the job, and determine them
for you.

  • app['database']['adapter']
    • Supported values: postgresql
    • Default: postgresql
    • ActiveRecord adapter which will be used for database connection. Currently only PostgreSQL is supported.
  • app['database']['username']
    • Username used to authenticate to the DB
  • app['database']['password']
    • Password used to authenticate to the DB
  • app['database']['host']
    • Database host
  • app['database']['database']
    • Database name
  • app['database'][<any other>]
    • Any other key-value pair provided here, will be passed directly to the database.yml


Those parameters can also be determined from OpsWorks application, and usually
you don't need to provide them here. Currently only git is supported.

  • app['scm']['scm_provider']
    • Supported values: git
    • Default: git
    • SCM used by the cookbook to clone the repo.
  • app['scm']['repository']
    • Repository URL
  • app['scm']['revision']
    • Branch name/SHA1 of commit which should be use as a base of the deployment.
  • app['scm']['ssh_key']
    • A private SSH deploy key (the key itself, not the file name), used when fetching repositories via SSH.
  • app['scm']['ssh_wrapper']
    • A wrapper script, which will be used by git when fetching repository via SSH. Essentially, a value of GIT_SSH environment variable. This cookbook provides one of those scripts for you, so you shouldn't alter this variable unless you know what you're doing.
  • app['scm']['enabled_submodules']
    • If set to true, any submodules included in the repository, will also be fetched.


Pre-optimalization for specific frameworks (like migrations, cache etc.).
Currently only Rails is supported.

  • app['framework']['adapter']
    • Supported values: rails
    • Default: rails
    • Ruby framework used in project.
  • app['framework']['migrate']
    • Supported values: true, false
    • Default: true
    • If set to true, migrations will be launch during deployment.
  • app['framework']['migration_command']
    • A command which will be invoked to perform migration. This cookbook comes with predefined migration commands, well suited for the task, and usually you don't have to change this parameter.
  • app['framework']['assets_precompile']
    • Supported values: true, false
    • Default: true
  • app['framework']['assets_precompilation_command']
    • A command which will be invoked to precompile assets.


Configuration parameters for the ruby application server. Currently only
Unicorn is supported.


Configuration for ruby workers. Currenty Null (no worker) and Sidekiq
are supported. Every worker is covered by monitd daemon out-of-the-box.

  • app['worker']['adapter']
    • Default: null
    • Supported values: null, sidekiq
    • Worker used to perform background tasks. null means no worker enabled.
  • app['worker']['process_count']
    • ** Default:** 2
    • How many separate worker processes will be launched.
  • app['worker']['syslog']
    • Default: true
    • Supported values: true, false
    • Log worker output to syslog?
  • app['worker']['config']
    • Configuration parameters which will be directly passed to the worker. For example, for sidekiq they will be serialized to sidekiq.yml config file.


Webserver configuration. Proxy passing to application is handled out-of-the-box.
Currently only nginx is supported.

Since this driver is basically a wrapper for nginx cookbook,
you can also configure node['nginx'] attributes
as well (notice that node['deploy'][<application_shortname>] logic doesn't
apply here.)


This cookbook provides five main recipes, which should be attached
to corresponding OpsWorks actions.

  • opsworks_ruby::setup - attach to Setup
  • opsworks_ruby::configure - attach to Configure
  • opsworks_ruby::deploy - attach to Deploy
  • opsworks_ruby::undeploy - attach to Undeploy
  • opsworks_ruby::shutdown - attach to Shutdown


for details.

Author and License

Author: Igor Rzegocki <>
License: MIT

Dependent cookbooks

build-essential ~> 2.0
deployer >= 0.0.0
ruby-ng >= 0.0.0
nginx ~> 2.7
application_ruby >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Foodcritic Metric

0.1.0 passed this metric