Vagrant and Puppet, Part 3: Introduce Puppet to Vagrant

After finishing Part 2 we now have a working virtual machine ready to use. The only problem now is there is barely anything on it to use, it is just a basic Ubuntu install.

At this point you normally go through the manual process of adding repositories, installing packages, setting up services, etc. Then if you wanted to reuse this machine you’d have to go through the process again. This is what Puppet fixes.

Puppet allows you to write a manifest of your virtual machine’s desired configuration and have it happen automatically. Let’s get started.

Step 1: Directories and Files

Create a new folder in your project and name it puppet.

Create a new folder named manifests and one named modules inside the puppet folder.

Inside manifests create a new text file named init.pp. This will be our main Puppet manifest. A manifest has the Puppet blocks that provision the machine.