Skip to content
tylerflint edited this page Jul 8, 2013 · 2 revisions

Installation

Ruby

If you don't have ruby installed, you might want to look at the following resources:

Caterer

Now that ruby is installed, caterer is distributed as a rubygem, and can be installed like this:

gem install caterer

Configuration

project creation and github

A cater project is just source code. No external tools, no clumsy web interfaces.

I highly recommend you start by making your cater project a git repo:

mkdir cater-project && cd cater-project
git init
git remote add origin GITHUB_REPO
git push origin master

Caterfile

Caterer reads it's configuration from a config file, Caterfile:

Caterer.configure do |config|

end

Images

Images describe the end configuration of a server.

Let's assume we're creating an image that would host a rails app:

  config.image :rails do |image|
    image.provision :chef_solo do |chef|
      chef.add_recipe 'ruby'
      chef.add_recipe 'mysql::server'
      chef.add_recipe 'mysql::client'
      chef.json = {
        "ruby" => {
          "gems" => ['mysql2']
        }
      }
    end
  end

The "rails" image above is defined in the Caterfile. It uses a chef-solo provisioner, and assumes the ruby and mysql cookbooks are accessible within this project. By default, you would place them in the "cookbooks" directory.

Create as many images as necessary to define your infrastructure. It is recommended to create many granular images that can be applied individually to a server. This way you can scale your infrastructure as necessary without having to re-define your caterer configuration.

Provision

The provision process will install software, configure services, and anything else the provisioner was told to do. This is where the magic happens.

cater provision HOST -i IMAGE -u USER -p PASSWORD

In the above example, the HOST is the ip address or domain, which is required. The USER and PASSWORD are optional

You may provision a server as many times as necessary. The workflow is catered to an iterative approach.