Text

I get really frustrated with Ruby packages, they promise so much and when on that special day the moon is aligned with Mars, it all just works, and life is great.

Unfortunately this doesn't happen very often and when using a stack of Rubygems, you almost always get bitten by something.

My cause for complaint today is Vagrant and Chef, well specifically Chef Solo. Vagrant is fine, it does what you tell it to do, but for most use-cases Chef Solo is the right tool to use for provisioning your virtual server. The Vagrant docs on Chef Solo unfortunately fib you, they say you can use Data Bags with Chef Solo, but by default you cannot.

This is a big deal as many useful Chef recipes make heavy use of Data Bags. Data Bags which let you provide environment specific configuration for your provisioning is not yet supported by the stock Chef Gem (currently version 10.12.0). In order to make use of Data Bags with Chef Solo, you need version 10.14.0 and above. This means building the gem from source.

I use Veewee to build my vagrant base boxes (you should too, it's awesome!), and you can edit the postinstall.sh file in your box definition folder to build Chef from source, rather than installing it directly via Rubygems.

You can repeat this for your local dev machine, and now you can get Chef Solo cooking up your recipes and happily using data bags.

Text

Veewee considerably simplifies the process of creating base distribution images for use with Vagrant, but unfortunately you have to choose between using the easy to install gem (which comes with horribly out of date basebox templates), or install the latest version from source, which unfortunately uses rvm in a pretty repugnant way.

So, if you want to use veewee to setup a new amd64 Precise Pangolin basebox for vagrant, you either have to pull the latest veewee sources from github, or download the most recent releases templates and copy them over into your veewee gem folder.

This is where veewee-templates-update steps in, it automates that latter step (downloading and installing just the updated templates) for you.

Installation is simple:

$ gem install veewee-templates-update
  

Then, just run the updater:

$ veewee-templates-update
  > Veewee: /home/aaron/.rvm/gems/ruby-1.9.3-p194/gems/veewee-0.2.3
  > Downloading: https://github.com/jedi4ever/veewee/tarball/master
  > Extracting: CentOS-4.8-i386 CentOS-5.5-i386-netboot CentOS-5.5-x86_64-netboot 
  > ...
  
  $ vagrant basebox define precise-amd64 ubuntu-12.04-server-amd64
  > ...
  > (profit)