Last Updated: February 25, 2016
·
3.391K
· runeroniek

Configuring Vagrant & Chef cookbooks, the right-way

Setup:

-

If you don't know what Vagrant is, look at the footnotes.

0 - Install the recent vagrant version from the list: http://downloads.vagrantup.com/

1 - After installation, go to terminal (or putty, if you use windows) and install the vbguest using the vagrant gem wrapper. This will check if there are updates for Guest Additions (a tool to allow sharing between the host and the VM):

Picture

2 - Put the vagrant-librarian gem into your Gemfile:

Picture

3 - Create a Cheffile in the root of your project (it's like Bundler, but for cookbooks) and put your cookbooks there. For instance, here's a sample from my Cheffile. (note that build-essential contains gcc):

Picture

4 - In your Vagrantfile, put the following:

Picture

5 - Create a directory cookbooks and put it on .gitignore

6 - Run vagrant up on the terminal

7 - Done. This will install your cookbooks, setup the machine and all the jazz.

8 - Of course you will need more cookbooks like postgres or mysql. Check the links bellow for more info.

9 - vagrant ssh and enjoy your setup.

-

Links

-

-

Cookbooks:

-