2014-01-08 06:46:34 -05:00
|
|
|
---
|
2017-06-14 21:04:16 -04:00
|
|
|
description: |
|
|
|
|
The puppet-server Packer provisioner provisions Packer machines with Puppet
|
|
|
|
by connecting to a Puppet master.
|
2015-07-22 22:31:00 -04:00
|
|
|
layout: docs
|
2017-06-14 21:04:16 -04:00
|
|
|
page_title: 'Puppet Server - Provisioners'
|
|
|
|
sidebar_current: 'docs-provisioners-puppet-server'
|
2017-03-25 18:13:52 -04:00
|
|
|
---
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2014-01-08 07:03:03 -05:00
|
|
|
# Puppet Server Provisioner
|
2014-01-08 06:46:34 -05:00
|
|
|
|
|
|
|
Type: `puppet-server`
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
The `puppet-server` Packer provisioner provisions Packer machines with Puppet by
|
|
|
|
connecting to a Puppet master.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
-> **Note:** Puppet will *not* be installed automatically by this
|
2015-07-22 22:31:00 -04:00
|
|
|
provisioner. This provisioner expects that Puppet is already installed on the
|
|
|
|
machine. It is common practice to use the [shell
|
|
|
|
provisioner](/docs/provisioners/shell.html) before the Puppet provisioner to do
|
|
|
|
this.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
|
|
|
## Basic Example
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
The example below is fully functional and expects a Puppet server to be
|
2016-12-28 23:33:44 -05:00
|
|
|
accessible from your network.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
``` json
|
2014-01-08 06:46:34 -05:00
|
|
|
{
|
|
|
|
"type": "puppet-server",
|
|
|
|
"options": "--test --pluginsync",
|
|
|
|
"facter": {
|
|
|
|
"server_role": "webserver"
|
|
|
|
}
|
|
|
|
}
|
2014-10-20 13:55:16 -04:00
|
|
|
```
|
2014-01-08 06:46:34 -05:00
|
|
|
|
|
|
|
## Configuration Reference
|
|
|
|
|
|
|
|
The reference of available configuration options is listed below.
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
The provisioner takes various options. None are strictly required. They are
|
|
|
|
listed below:
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `client_cert_path` (string) - Path to the directory on your disk that
|
2016-12-28 23:33:44 -05:00
|
|
|
contains the client certificate for the node. This defaults to nothing,
|
|
|
|
in which case a client cert won't be uploaded.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `client_private_key_path` (string) - Path to the directory on your disk that
|
2016-12-28 23:33:44 -05:00
|
|
|
contains the client private key for the node. This defaults to nothing, in
|
|
|
|
which case a client private key won't be uploaded.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `facter` (object of key/value strings) - Additional Facter facts to make
|
2015-07-22 23:25:58 -04:00
|
|
|
available to the Puppet run.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `ignore_exit_codes` (boolean) - If true, Packer will never consider the
|
2015-07-22 23:25:58 -04:00
|
|
|
provisioner a failure.
|
2015-06-19 00:09:22 -04:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `options` (string) - Additional command line options to pass to
|
2016-12-28 23:33:44 -05:00
|
|
|
`puppet agent` when Puppet is run.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `prevent_sudo` (boolean) - By default, the configured commands that are
|
2015-07-22 23:25:58 -04:00
|
|
|
executed to run Puppet are executed with `sudo`. If this is true, then the
|
|
|
|
sudo will be omitted.
|
2014-05-04 13:47:40 -04:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `puppet_node` (string) - The name of the node. If this isn't set, the fully
|
2015-07-22 23:25:58 -04:00
|
|
|
qualified domain name will be used.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `puppet_server` (string) - Hostname of the Puppet server. By default
|
2015-07-22 23:25:58 -04:00
|
|
|
"puppet" will be used.
|
2014-01-08 06:46:34 -05:00
|
|
|
|
2017-01-12 19:45:18 -05:00
|
|
|
- `staging_dir` (string) - This is the directory where all the configuration
|
|
|
|
of Puppet by Packer will be placed. By default this is "/tmp/packer-puppet-server"
|
|
|
|
when guest_os_type unix and "C:/Windows/Temp/packer-puppet-server" when windows.
|
|
|
|
This directory doesn't need to exist but must have proper permissions so that
|
|
|
|
the SSH user that Packer uses is able to create directories and write into this
|
|
|
|
folder. If the permissions are not correct, use a shell provisioner prior to this
|
|
|
|
to configure it properly.
|
2016-06-13 09:12:28 -04:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `puppet_bin_dir` (string) - The path to the directory that contains the puppet
|
2016-12-28 23:33:44 -05:00
|
|
|
binary for running `puppet agent`. Usually, this would be found via the `$PATH`
|
|
|
|
or `%PATH%` environment variable, but some builders (notably, the Docker one) do
|
|
|
|
not run profile-setup scripts, therefore the path is usually empty.
|
2016-10-16 16:24:56 -04:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `execute_command` (string) - This is optional. The command used to execute Puppet. This has
|
2016-06-13 09:12:28 -04:00
|
|
|
various [configuration template
|
2017-01-12 19:45:18 -05:00
|
|
|
variables](/docs/templates/configuration-templates.html) available. See
|
|
|
|
below for more information.
|
|
|
|
|
|
|
|
- `guest_os_type` (string) - The target guest OS type, either "unix" or
|
|
|
|
"windows". Setting this to "windows" will cause the provisioner to use
|
|
|
|
Windows friendly paths and commands. By default, this is "unix".
|
2016-12-14 23:47:35 -05:00
|
|
|
|
|
|
|
## Default Facts
|
|
|
|
|
|
|
|
In addition to being able to specify custom Facter facts using the `facter`
|
|
|
|
configuration, the provisioner automatically defines certain commonly useful
|
|
|
|
facts:
|
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `packer_build_name` is set to the name of the build that Packer is running.
|
2016-12-14 23:47:35 -05:00
|
|
|
This is most useful when Packer is making multiple builds and you want to
|
|
|
|
distinguish them in your Hiera hierarchy.
|
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `packer_builder_type` is the type of the builder that was used to create the
|
2016-12-14 23:47:35 -05:00
|
|
|
machine that Puppet is running on. This is useful if you want to run only
|
|
|
|
certain parts of your Puppet code on systems built with certain builders.
|