2013-09-03 18:08:28 +00:00
|
|
|
---
|
2016-01-19 18:08:53 +00:00
|
|
|
layout: "docs"
|
2013-09-06 16:50:43 +00:00
|
|
|
page_title: "Puppet Agent - Provisioning"
|
2013-09-03 18:08:28 +00:00
|
|
|
sidebar_current: "provisioning-puppetagent"
|
2016-01-19 18:08:53 +00:00
|
|
|
description: |-
|
2016-01-19 19:54:13 +00:00
|
|
|
The Vagrant Puppet agent provisioner allows you to provision the guest using
|
|
|
|
Puppet, specifically by calling "puppet agent", connecting to a Puppet master,
|
|
|
|
and retrieving the set of modules and manifests from there.
|
2013-09-03 18:08:28 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Puppet Agent Provisioner
|
|
|
|
|
|
|
|
**Provisioner name: `puppet_server`**
|
|
|
|
|
2016-01-19 18:08:53 +00:00
|
|
|
The Vagrant Puppet agent provisioner allows you to provision the guest using
|
|
|
|
[Puppet](https://www.puppetlabs.com/puppet), specifically by
|
2013-09-03 18:08:28 +00:00
|
|
|
calling `puppet agent`, connecting to a Puppet master, and retrieving
|
|
|
|
the set of modules and manifests from there.
|
|
|
|
|
2016-01-19 18:08:53 +00:00
|
|
|
<div class="alert alert-warning">
|
2016-01-19 19:54:13 +00:00
|
|
|
<strong>Warning:</strong> If you are not familiar with Puppet and Vagrant already,
|
|
|
|
I recommend starting with the <a href="/docs/provisioning/shell.html">shell
|
|
|
|
provisioner</a>. However, if you are comfortable with Vagrant already, Vagrant
|
|
|
|
is the best way to learn Puppet.
|
2013-09-03 18:08:28 +00:00
|
|
|
</div>
|
|
|
|
|
2013-11-25 23:06:05 +00:00
|
|
|
## Options
|
|
|
|
|
|
|
|
The `puppet_server` provisioner takes various options. None are strictly
|
|
|
|
required. They are listed below:
|
|
|
|
|
2015-10-10 18:48:31 +00:00
|
|
|
* `binary_path` (string) - Path on the guest to Puppet's `bin/` directory.
|
|
|
|
|
2013-11-25 23:06:05 +00:00
|
|
|
* `client_cert_path` (string) - Path to the client certificate for the
|
|
|
|
node on your disk. This defaults to nothing, in which case a client
|
2016-01-19 18:08:53 +00:00
|
|
|
cert will not be uploaded.
|
2013-11-25 23:06:05 +00:00
|
|
|
|
|
|
|
* `client_private_key_path` (string) - Path to the client private key for
|
|
|
|
the node on your disk. This defaults to nothing, in which case a client
|
2016-01-19 18:08:53 +00:00
|
|
|
private key will not be uploaded.
|
2013-11-25 23:06:05 +00:00
|
|
|
|
|
|
|
* `facter` (hash) - Additional Facter facts to make available to the
|
|
|
|
Puppet run.
|
|
|
|
|
|
|
|
* `options` (string or array) - Additional command line options to pass
|
|
|
|
to `puppet agent` when Puppet is ran.
|
|
|
|
|
2016-01-19 18:08:53 +00:00
|
|
|
* `puppet_node` (string) - The name of the node. If this is not set,
|
2013-11-25 23:06:05 +00:00
|
|
|
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.
|
|
|
|
|
2013-09-03 18:08:28 +00:00
|
|
|
## Specifying the Puppet Master
|
|
|
|
|
|
|
|
The quickest way to get started with the Puppet agent provisioner is to just
|
|
|
|
specify the location of the Puppet master:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
config.vm.provision "puppet_server" do |puppet|
|
|
|
|
puppet.puppet_server = "puppet.example.com"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
By default, Vagrant will look for the host named "puppet" on the
|
|
|
|
local domain of the guest machine.
|
|
|
|
|
|
|
|
## Configuring the Node Name
|
|
|
|
|
|
|
|
The node name that the agent registers as can be customized. Remember
|
|
|
|
this is important because Puppet uses the node name as part of the process
|
|
|
|
to compile the catalog the node will run.
|
|
|
|
|
|
|
|
The node name defaults to the hostname of the guest machine, but can
|
|
|
|
be customized using the Vagrantfile:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
config.vm.provision "puppet_server" do |puppet|
|
|
|
|
puppet.puppet_node = "node.example.com"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
## Additional Options
|
|
|
|
|
|
|
|
Puppet supports a lot of command-line flags. Basically any setting can
|
2014-05-01 14:22:05 +00:00
|
|
|
be overridden on the command line. To give you the most power and flexibility
|
2013-09-03 18:08:28 +00:00
|
|
|
possible with Puppet, Vagrant allows you to specify custom command line
|
|
|
|
flags to use:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
config.vm.provision "puppet_server" do |puppet|
|
|
|
|
puppet.options = "--verbose --debug"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
```
|