0

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!

4

1 回答 1

1

Jepp 可能会认为,在指定来宾之外管理食谱是违反可移植性原则的,但这个空白可以用两个简单的 Vagrant 插件来填补,它们集成了图书馆管理员或 berkshelf(它们只是以不同的方式做同样的事情),这样在每次vagrant up运行之前,例如 berkshelf 会自动执行 - 确保开发人员必须安装此插件 + Vagrant + Virtualbox + Veewee/其他一些 basebox,但此设置是一次性的。

对于我正在使用这样一个插件的图书馆员厨师来说,可能是这个

HIH

于 2013-05-10T08:57:39.573 回答