Setting up a Crowbar Development box – the Vagrant way

Vagrant UP!

I’m running 64 bit Ubuntu 12.04.1, and I’d like to use VirtualBox 4.2, I had to install that PPA:

root@judd-m6600:~# wget -q -O - | sudo apt-key add -
root@judd-m6600:~# sudo sh -c 'echo "deb precise non-free contrib" >> /etc/apt /sources.list.d/'

I got my VirtualBox 4.2 installed with

apt-get install virtualbox-4.2

It complained a bit about deps, but I ignored those complains. The VirtualBox 4.2 install ran just fine, installing the kernel modules as necessary.

Now I don’t want the old Vagrant that’s in Ubuntu 12.04.1. I’d like the latest and greatest that works with VirtualBox 4.2

apt-get install rubygems
gem install vagrant

After much churning, I have Vagrant 1.0.5 installed.

Setup the Vagrant development environment, on my secondary drive, the SSD.

mkdir /VMs/vagrant_home
echo 'export VAGRANT_HOME=/VMs/vagrant_home' >> ~/.bashrc
. ~/.bashrc
vagrant init
vagrant box add
vagrant init precise64
vagrant ssh

Let the cookbooks commence!

Hacking up some cookbooks to setup the Crowbar Dev Env

Setting up the repo

mkdir /VMs/vagrant_crowbar
cd /VMs/vagrant_crowbar
vagrant init

Writing the recipes

I started with the Vagrantfile, which I realized could be the decision point for a variety of different possible installations.  So a separate configuration file would be useful: personal.json.

Supported installations would take into account different proxy configurations: corporate NTLM proxy, simple host based proxy, and simple client only proxy.  In all cases, there would be a client proxy.
So, based on the contents of personal.json, different general settings (username, hostname, ssh-pubkeys) and different proxy settning (cntlm settings, upstream proxy, etc). I then wrote the Vagrantfile to include or exclude recipes based on those conditions.
The recipes themselves were challenging.  I tried to use the rvm cookbook by fnichols, but it tries to use Ruby Gems that are not yet present in the system, and does not pick up my proxy settings.  Rather than hack my cookbooks to setup proxy during the compile phase of a Chef run, I did the rvm setup work myself through bash and execute Chef resources.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s