» Puppet Agent Provisioner

Provisioner name: puppet_server

The Vagrant Puppet agent provisioner allows you to provision the guest usingPuppet, specifically bycalling puppet agent, connecting to a Puppet master, and retrievingthe set of modules and manifests from there.

Warning: If you are not familiar with Puppet and Vagrant already,it is recommended to start with the shellprovisioner. However, if you are comfortable with Vagrant already, Vagrantis the best way to learn Puppet.

» Options

The puppet_server provisioner takes various options. None are strictlyrequired. They are listed below:

  • binary_path (string) - Path on the guest to Puppet's bin/ directory.

  • client_cert_path (string) - Path to the client certificate for thenode on your disk. This defaults to nothing, in which case a clientcert will not be uploaded.

  • client_private_key_path (string) - Path to the client private key forthe node on your disk. This defaults to nothing, in which case a clientprivate key will not be uploaded.

  • facter (hash) - Additional Facter facts to make available to thePuppet run.

  • options (string or array) - Additional command line options to passto puppet agent when Puppet is ran.

  • puppet_node (string) - The name of the node. If this is not set,this will attempt to use a hostname if set via config.vm.hostname.Otherwise, the box name will be used.

  • puppet_server (string) - Hostname of the Puppet server. By default"puppet" will be used.

» Specifying the Puppet Master

The quickest way to get started with the Puppet agent provisioner is to justspecify the location of the Puppet master:

  1. Vagrant.configure("2") do |config|
  2. config.vm.provision "puppet_server" do |puppet|
  3. puppet.puppet_server = "puppet.example.com"
  4. end
  5. end

By default, Vagrant will look for the host named "puppet" on thelocal domain of the guest machine.

» Configuring the Node Name

The node name that the agent registers as can be customized. Rememberthis is important because Puppet uses the node name as part of the processto compile the catalog the node will run.

The node name defaults to the hostname of the guest machine, but canbe customized using the Vagrantfile:

  1. Vagrant.configure("2") do |config|
  2. config.vm.provision "puppet_server" do |puppet|
  3. puppet.puppet_node = "node.example.com"
  4. end
  5. end

» Additional Options

Puppet supports a lot of command-line flags. Basically any setting canbe overridden on the command line. To give you the most power and flexibilitypossible with Puppet, Vagrant allows you to specify custom command lineflags to use:

  1. Vagrant.configure("2") do |config|
  2. config.vm.provision "puppet_server" do |puppet|
  3. puppet.options = "--verbose --debug"
  4. end
  5. end