Provisioning with Puppet on Vagrant
Vagrant supports two methods of using Puppet:
Puppet in standalone mode using the
puppet apply
command on the VMPuppet in client/server mode, whereby the VM (using the Puppet agent) will be configured from a central server
Let's take a look at how to configure Vagrant with Puppet using these two different methods.
Using Puppet in standalone mode
Puppet standalone is the simplest way to use Puppet with Vagrant. We simply tell Vagrant where we have put our Puppet manifests and modules, and what manifest should be run. The smallest amount of configuration we need within our Vagrant file in order to use Puppet is this:
config.vm.provision "puppet" do |puppet| end
This should go within the Vagrant.configure("2") do |config| … end
block of code within the Vagrant file.
Along with this configuration, we will need a Puppet manifest called default.pp
in the manifests
folder of our project root. Vagrant will then use this to provision the machine.
This will instruct Vagrant...