Sam Cassiba


Berkshelf and Multiple Chef Servers

| Comments

At work, we have multiple unique Chef Servers. They each serve different purposes. However, many components that are used are the same; one being Berkshelf. But, I ask, how do you deal with uploading cookbooks to different Chef Servers using your local workstation? You can manually move things around, create some scripts to do it, whatever. I came up with my own solution without having to write a single line of code.

I’m going to assume you know how to use Berkshelf since you’re reading this. Here’s what you do:

  • Install chefvm and create your environments
  • Create a symlink from ~/.berkshelf/config.json to ~/.chef/config.json
  • Drop your config.json files into ~/.chefvm/configurations/config_name{1,2,3}
  • ???
  • Profit

Now, when you issue ‘chefvm use config_name1’, Berkshelf will have the correct config. Simple as that.

Hello World

Howdy! My name is Sam Cassiba and this is my blog.

I’m using Octopress to serve this site via GitHub Pages. Look ma, no servers!

Getting started

To get started, create a new GitHub repo called

This is important because GitHub Pages will automatically look at this repository and serve up the content it finds in the master branch at

Clone Octopress and change to the new directory:

$ git clone git://
$ cd

Install bundler and required gems:

$ gem install bundler
$ bundle install

Install the default theme:

$ rake install

Octopress has a rake task that automatically sets the repo up for deployment to GitHub Pages:

$ rake setup_github_pages

This task creates a new _deploy directory that is itself another git repository. This is where Octopress generates the flat website for deployment to the master branch of your repo on GitHub.

Octopress has rake tasks to make this easy to manage. Before going further, make sure everything checks out:

$ rake generate
$ rake deploy

This copies the generated files into _deploy, adds them to git, commits and pushes them up to the master branch.

Visit in a browser to see your new site.

At this point, only the website has been committed. The source itself needs to be committed separately via:

$ git add .
$ git commit -m 'Initial source commit'
$ git push origin source

Theme customization

I’m using the ‘Whitespace’ theme by lucaslew.

I installed the theme by running the following in the root of the source branch. Say yes when it asks you to overwrite existing files.

$ git clone git:// .themes/whitespace
$ rake install['whitespace']
$ rake generate


This is where the main site configuration lives. Things like the blog title and various third-party settings, Twitter handle, GitHub profile, etc.

Creating a new post

Easy as 3.14159:

$ rake new_post["Hello World"]

Deploying to GitHub Pages

$ rake generate
$ rake deploy

Make sure to manually commit changes made in the source branch.

Custom domain

GitHub has full details on how to do this in the GitHub Pages Documentation.

Inside your source branch run the following:

echo '' >> source/CNAME

Regenerate your site and deploy up to GitHub. In your DNS settings point an A record (for your naked domain) to

For www just point a CNAME record to