This directory contains recipes to be used together with Capistrano. To use recipe in the deployment require needed file(s) from your deploy.rb
file.
Note: Do not automatically require all files. Some recipes implement same functionally differently depending on your requirements.
Many cookbooks here are heavily modified after forking from original author. Main idea for new functionality is to provide means of integrating Capistrano with Chef-solo, where Capistrano is used for application deployment, and Chef is used for all infrastructure related tasks: bootstraping servers, installing software, etc.
This repository is closely related to another one (dmytro/chef-solo) and tested with it.
TBD
TBD
TBD
It is possible to use Chef databags in Capistrano recipes. Databags are loaded from either custom Chef-solo path or from standard one. If custom path is defined (variable :custom_chef_solo
defined when recipe custom_chef_solo
is loaded), then custom path is used.
- Example (see recipe mysql.rb):
root_password = get_data_bag(:users, "mysql")["root_password"]
set :database, get_data_bag(:application, "database")
- Limitations
- Databags are loaded on the local server, which means that node attributes are not known.
- No search functionality, only load
- base.rb - this file is required. It sets some common methods used in other recipes.
File base.rb
contains several extensions that can be useful with Capistrano deployments (and also used in this recipes collection).
Load file with recipe by it's name. Just a helper.
Same as upload
in Capistrano but for whole directory by tarring it locally and untarring remotely.
Ask for root
password and execute command remotely via su -
. Fallback for the situations when sudo is not installed.
Helper to parse and upload to remote ERB template.
Set variable conditionally.
- rbenv.rb - TODO
- setup.rb - Change ownership of the created directories at the setup stage
:deploy:chown_dirs
- ensure_tagged_release - if this recipe is included, before deployment it will check that current checked out deployment code (not application) is tagged. This is to ensure that production setups are released only using stable code. Relase tag should be formatted acordingly to Semantic versioningn (vA.B.C).
- logs.rb - Manage log/production.log file: tail and truncate
- sudo.rb - Install sudo on the remote server. Do nothing if sudo installed.
- chef_solo.rb - 2 tasks
chefsolo:deploy
- Run chef-solo deploy on the remote server (bootstrap server)chefsolo:run_remote
- deploy single JSON chef-solo file
chef_solo_roles.rb
chefsolo:roles
chef_solo_roles.rb - Deploy JSON file corresponding to role (useschefsolo:run_remote
)
- puppet.rb
Similar to chef-solo above. Bootstraps puppet and provide task to execute manifest remotely. Puppet recipe requires chef-solo bootstrap.
- File: http_proxy.rb
Setup HTTP proxy to access network via gateway server. HTTP server must have role :proxy
, all other hosts configured as proxy clients.
TODO: refactor install to use Chef
- Template
- templates/nginx.conf.erb
Recipe to restart Nginx on systems with Monit
- Templates
- templates/apache_unicorn_modules.json.erb
- templates/apache_unicorn_virtual_host.conf.erb
- Template - templates/unicorn.rb.erb
- database.rb: Manage DB yaml config for Rails
database:setup
Generate the database.yml configuration file.database:symlink
- Template
- templates/database.yml.erb
- postgresql.rb - Manage Postgres for Rails (namespace
:postgresql
):install
- TODO: refactor install to use Chef:drop_database
:create_database
:setup
:symlink
- Template
- templates/postgresql.yml.erb
- postgresql_backup.rb - Backup remote PostgreSQL server. Automatically create pre/post backups on deploy. Namespace
:postrgresql
.:setup
:production
:production_pre
:production_post
- memcached.rb - TODO refactor to use Chef
- Template
- templates/memcached.erb
- Template
- application_yml_file.rb - Manage config/application.yml file: concatenate example and secrets files
- Asset Precompile recipes - see {file:ASSETS_PRECOMPILE.md} for details
- assets_precompile.rb
- assets_precompile_conditional.rb
- assets_precompile_local.rb
- check.rb - deprecated
- fast.rb
- nodejs.rb - TODO: refactor install to use Chef
- talks.rb - TODO