To facilitate developing my Puppet code, the Pro Puppet book suggests using Vagrant. Seeing as I’ve been meaning to get around to learning it for a while I decided now was the time to finally do so. The only problem is that, being a responsibly paranoid SysAdmin, I was never a fan of using a base for my work that I didn’t know the contents of. I also never liked the idea of basing my work off of something I didn’t understand (a Vagrant box) or that could go away at anytime.
Box building time
The solution to my dilemma was to learn how to use Vagrant and to make my own base boxes for it. Their site does a good job of listing the minimum specs and Puppet Labs publishes the recipes for their base boxes that are built using Veewee on GitHub. Between these two resources I was able to figure most stuff out and built a CentOS 6 vm that was to be my base. I was then able to use another tool called Packer to reference the VMX file and build a box from it.
I have a box, now what?
Once I built this first iteration of my box I setup an account on Vagrant Cloud, setup space on my personal server to host the boxes, and published my VMware Fusion box. The problem was that I couldn’t publish my Packer template because it was dependent on a custom vm.
**Packer to the Rescue, Again **
I then dove into Packer a bit more and, thanks to another resource found on GitHub, was able to take what I learned from my first box and produce base boxes for both VirtualBox & VMware Fusion using a fairly simple template file, some shell scripts, an ISO, and a kickstart file. These new boxes are exactly what I was aiming for. I’ve published the template on GitHub and, after a bit more testing, will be publishing the boxes on my Vagrant Cloud account.
Once those boxes are vetted I’ll be making versions with Puppet pre-installed so that I can get back to the book.