UPDATE (20/11/2011): The hacks here are superseded by updates in chef-solo and vagrant. Check out Ches Martin’s useful comment below.
I’m using a vagrant instance configured (initially) to use chef-solo. Because I will eventually be using chef with the opscode platform, I’ve acquired a couple of hacks that help me use data-bags when using vagrant.
I could of course use the vagrant instance with chef-server linking to the platform, however I find I make too many mistakes in my config in the early work-up of my config and the additional time to (knife cookbook) upload my recipes to the server and then pull them down as well makes the development loop somewhat frustrating. Chef solo provisioning allows the vagrant instance to just link across my recipes directly into the VM and run them from there.
When I’m happy with config working in vagrant (and I destroy the vagrant and re-provision) then I try the same on my rackspace (or ec2 or whatever) instance. Usually I find I need to modify one or two things (forgotten “depends” in cookbook metadata files).
I’m doing mostly quite trivial configs which require only a one server (times two if there’s a staging and a production server), so I don’t typically have the reworking which moving from a single vagrant instance to a multi-tier server architecture would require.
Here are the hacks I use:
- I don’t like writing json unless I can avoid it, so like to write my roles in ruby. Chef-server translates them automatically (mantra from opscode training: “no ruby is run on the server”). I’ve created a rake task to convert roles from ruby to json: https://gist.github.com/834890
- A monkeypatch for Vagrant’s chef-solo provisioner to allow it to link in your data_bags folder onto the server https://gist.github.com/867958
- A monkeypatch for Chef-solo to allow it to manipulate data_bags very basically: https://gist.github.com/867960