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):
2 - Put the vagrant-librarian gem into your Gemfile
:
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):
4 - In your Vagrantfile
, put the following:
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
-
Vagrant documentation:
http://docs.vagrantup.com/v1/docs/getting-started/index.htmlLibrarian-Chef gem documentation:
https://github.com/applicationsonline/librarianVagrant-Librarian gem documentation:
https://github.com/thegcat/vagrant-librarianVagrant-VbGuest (Virtual Box Guest additions) gem documentation: https://github.com/dotless-de/vagrant-vbguest
-
Cookbooks:
-
- From the source: http://community.opscode.com/cookbooks
- From OpsCode github: https://github.com/opscode-cookbooks
- From Fletcher Nichol github: https://github.com/fnichol
- From BlueBox: https://github.com/bbg-cookbooks