Crowbar uses its own opens source Chef instance. After a default installation it is not very easy to update cookbooks from your local development environment. This howto describes a more usable configuration of local crowbar environment.

Setup your local environment

Clone the crowbar git repository to a local path

git clone
cd crowbar

Setup your development environment with the dev tool.

Changes for OSX

The crowbar dev tool needs a bash version higher than 4. Here is a blog post on how to change the default shell to a homebrew bash shell. As long as the Crowbar team did not merge my change you additionally have to change the shebang line in the dev tool.

Configure Crowbar Environment

Set System Time

As chef protects against replay attacks we need to sync the system time of the crowbar admin server and the local development machine. If you did not configure a working ntp configuration in the crowbar environment you have to update the time on the crowbar environment every now and then (especially in a Virtualbox environment after resume).

Get your local time

echo \'date -us \"`date -u "+%Y-%m-%d %H:%M"`\"\' 
'date -us "2012-10-10 18:07"'

and set it on all nodes (from the crowbar admin machine as root)

knife ssh node:* -- 'date -us "2012-10-10 18:07"'

Create DevOps Chef Client Key

In order to work from your local machine we must register it as a chef-client. To do so login to your Crowbar admin server (if you followed Deployment of Openstack on a Virtualbox Multi Node Environment the server IP is and create a devops client key (for a more detailed discussion please visit and

root@admin:~# export MY_CLIENT_NAME="devops" ;knife client create $MY_CLIENT_NAME -d -a -f /tmp/$MY_CLIENT_NAME.pem
Created client[devops]    

Next copy your devops.pem file from the admin machine to the local crowbar repository directory

your-laptop > mkdir .chef
your-laptop > MY_CLIENT_NAME="devops"; scp crowbar@$MY_CLIENT_NAME.pem ~/.chef/$MY_CLIENT_NAME.pem

Copy the template knife.rb file and set the server url to the correct value (if its not already merged you can find it here:

cp .chef/knife.rb.example .chef/knife.rb 

copy the template .rvmrc in place and trust it (or install the corresponding ruby) (if its not already merged you can find it here:

cp dot-rvmrc .rvmrc
rvm rvmrc trust .
rvm rvmrc load

install chef with the Gemfile (if its not already merged you can find it here:

bundle install

finally you can work with knife from your local maschine:

$ knife status
6 minutes ago,,,, ubuntu 12.04.
4 minutes ago,,,, ubuntu 12.04.
4 minutes ago,,,, ubuntu 12.04.
3 minutes ago,,,, ubuntu 12.04.

Now you can do all sorts of things like uploading cookbooks, uploading or edit data_bags and roles etc. More on knife can be found here:

Interested in Cloud or Chef Trainings? Have a look at our Commandemy Trainings page. Need help migrating to the cloud? Check out Infralovers.

comments powered by Disqus
Blog Tags