Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
My chef-solo setup for deploying ruby on rails to a fresh server
Ruby Shell HTML

This branch is 40 commits ahead of msolovyov:master

Merge pull request #2 from dmytro/hotfix/use_native_rvm_package_insta…

…llation

Hotfix/use native rvm package installation
latest commit 6b97e423ac
@dmytro authored
Failed to load latest commit information.
lib/tasks Start rake task for librarian.
profiles Move sumbodule outide of chef-solo.
site-cookbooks mv ssh/config file creation from default to designer
.gitignore Add documentation for custom setups- WIP
.ruby-version Remove unused stuff, configure to use .ruby-version.
.yardopts Options file for YARD.
CentOS6.3-Vault.repo Support for Vault repositories for CentOS
KNOWN_PROBLEMS.md Information about rubygems fix.
README.md Add ability to use custom solo config root directory.
Rakefile Move sumbodule outide of chef-solo.
deploy.sh
empty.json empty deploy file
install.conf Latest Chef.
install.sh Use getent instead of grep.
run_roles.rb Generating networking config JSON for the hosts.
solo.rb Even less verbosity.

README.md

Chef-solo

Bootstrapping Ruby or Ruby on Rails server on a Linux/MacOSX machine. Bootstrapping installs prerequisite for RVM, RVM itself, Ruby and Chef. At the end script executes chef-solo using provided JSON configuration file.

Usage

Remotely

./deploy.sh <user>@<host> <json>

json - This is optional. I've put this there so you can have different server setup config files. e.g.: web_server.json

There's empty JSON file, included now. If you need only install RVM, Ruby and Chef, run as:

./deploy.sh ... empty.json

Locally

You can simply bootstrap your local machine if you need to. In this case you'd need root or sudo access and networking setup only. Instead of using ./deploy.sh script, use ./install.sh as:

[sudo] bash ./install.sh <JSON>

Requirements

  • Clean install server machine with password less SSH access and password less sudo for your user for remote installation.
  • curl
  • sudo

Cookbooks

Script uses librarian gem to manage Chef cookbooks. Cookbook's are downloaded into ./cookbooks directory. You can also use own cookbooks, managed manually and installed in ./site-cookbooks.

To use librarian, after updating Cheffile file, run in the repository directory:

 bundle install                       # Installs librarian
 librarian-chef install               # Installs cookbooks

Customizing chef-solo

In order to be able to use same chef-solo repository with multiple custom setups place your configuration in profiles subdirectory.

Integrating chef-solo with Capistrano

TBD

Bootstrapping

Before using Chef on a server it is bootstrapped by install.sh script. Chapter below describes install.sh in more details.

Supported by install.sh

OS's:

  • MacOS (Darwin)
  • Debian (Same group as Ubuntu)
  • RHEL/CentOS with Rpmforge

Tested with

  • OS

    • MacOSX 10.7.x
    • CentOS 5.8
    • Debian 6.x
    • Ubuntu 10.x, 12.x
  • Ruby

    • 1.9.3-pXXX
    • 2.0.0-p0, p195
  • Chef

    • 0.10.x, 10.x
    • 11.4.x

Configuration

Install.conf

File install.conf Contains fallowing configuration for install.sh script:

  • RVM version
  • Ruby version
  • Chef version
  • RPM forge release for CentOS/RHEL
  • Rubygems - as of may/2013, Rubygems need to be downgraded when used with Ruby 2.x and Chef 11. Corresponding section added.

solo.rb

Solo.rb is configuration file for chef-solo binary. Contains PATH information for cookbooks, roles, logs.

Something went wrong with that request. Please try again.