discourse/discourse — pull request #61 by statik (2013-02-07 19:20:22+00:00)
Title: Vagrant chef

Possibly controversial, I don't know if y'all already have plans in place for configuration management. I see that there is a delightful amount of customization done to the vagrant base box, but it doesn't seem to be scripted using configuration management (at least not that I can see). It won't hurt my feelings if you reject this or want to discuss more, I figured I'd throw some working code up.

This pull request introduces the use of chef-solo to configure the Vagrant VM on boot, and this branch takes care of installing a modern version of phantomjs which enables running more tests out of the box, so there is some direct value here for folks using Vagrant. This could allow getting rid of the phantom_path hack in the Guardfile.

Two configuration management runs are added into the
Vagrant provisioning phase. The first chef-solo run ensures that
a current version of chef is installed using the omnibus updater.
The second chef-solo run installs vim and phantomjs.

Much more is possible, this is a proof of concept.
Cookbooks are stored in the chef directory, and managed by
librarian-chef, which is like a bundler for cookbooks.

Chef is run when VM is first downloaded and booted, but not on
subsequent halt/up cycles. To force chef to run again, use
`vagrant provision`.