Veewee, Vagrant and Berkshelf integration

331 views Asked by At

I'm trying to learn how to set up a virtual development environment using VirtualBox, Veewee, Vagrant and Chef-solo with Berkshelf.

Since I'm very new to this, I've read all I could find online, but I think I'm missing something crucial. Hopefully somebody here can help me understand.

The part I'm having problems with is provisioning the Veewee-generated Vagrant box using Chef-solo and Berkshelf.

From my point of view, the main advantage of using Vagrant and virtual environments is that they're reproducible and portable, so I do not understand why I have to install the Berkshelf gem and download recipes on my local host machine.

Why isn't all this done on the guest?

If I give my customized Vagrantfile to someone else, vagrant up will not work on their machine because the Vagrantfile references local recipes the other person will not have by default. Installing Berkshelf and recipes on their machine as well kinda defeats the purpose and so does referencing recipes available on the web somewhere.

Isn't it a better idea to just install the Berkshelf gem on the guest, download recipes locally there and tell Vagrant to use the recipes on the guest? I couldn't find any reference in the new Vagrant documentation on how to do this, but in the old version specifying cookbook folders within the virtual machine was an available option.

So basically what I'd like to know is:

  1. Is my reasoning a valid option or am I missing either a useful tool or the general picture?

  2. If my reasoning is valid, could you please point me in the right direction of how to do this? I was thinking of finding out how to customize the Veewee templates for building the Vagrant base box, using a post installation script to add Berkshelf and download recipes, but perhaps it's either overkill or the wrong way to go about this?

Thanks in advance!

1

There are 1 answers

1
cmur2 On BEST ANSWER

Jepp one could think that managing the cookbooks outside the designation guests is against the principle of portibility but this gap can be filled with two simple plugins for Vagrant that integrate librarian-chef or berkshelf (which are doing merely the same in different ways) so that before every vagrant up run e.g. berkshelf is executed automatically - sure the dev has to install this plugins + Vagrant + Virtualbox + Veewee/some other baseboxes but this setup is a one-time effort.

For librarian-chef which I'm using such a plugin might be this.

HIH