Recently at work, the vCloud Air Zombie team has been using Packer to generate Vagrant templates for use in development and testing. I have previously covered how to use Packer to create create a .box template for use with Vagrant, but I thought it might be useful to others to demonstrate how we are using Packer to create images.
This will be the first of several blog posts in which I intend to cover:
- Installing a ESXi 6.0 virtual machine for use with Packer - this is where Packer will be creating the virtual machine image.
- Setting up Packer, ovftool and Apache web server on a CentOS virtual machine - this will be where we will be editing and running the Packer templates.
- Creating our first Packer template for installing CentOS 6.7 with vmtools - templates are the instructions for how a Packer image should be built.
- Copying our existing CentOS 6.7 template and adding the Puppet agent - having the puppet agent in an image allows us to use puppet to describe configurations using puppet in either Packer and Vagrant.
- Using ovftool to convert Packer generated virtual machines into Vagrant .box files - ovftool allows you to export the Packer created images in either a Fusion or vSphere compatible format.
- Scripted Packer build, ovftool export and Vagrant .box file creation - pulling everything we have done with Packer template creation and ovftool export into a single script
I have also created a github repository to contain the Packer configuration files using during this series. You can access the github repository at https://github.com/sdorsett/packer-templates.
These posts will hopefully be helpful by providing details on the process of using Packer to generate Vagrant .box files.