github.com/jerryclinesmith/packer@v0.3.7/website/source/docs/provisioners/puppet-masterless.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Puppet (Masterless) Provisioner"
     4  ---
     5  
     6  # Puppet (Masterless) Provisioner
     7  
     8  Type: `puppet-masterless`
     9  
    10  The masterless Puppet provisioner configures Puppet to run on the machines
    11  by Packer from local modules and manifest files. Modules and manifests
    12  can be uploaded from your local machine to the remote machine or can simply
    13  use remote paths (perhaps obtained using something like the shell provisioner).
    14  Puppet is run in masterless mode, meaning it never communicates to a Puppet
    15  master.
    16  
    17  <div class="alert alert-info alert-block">
    18  <strong>Note that Puppet will <em>not</em> be installed automatically
    19  by this provisioner.</strong> This provisioner expects that Puppet is already
    20  installed on the machine. It is common practice to use the
    21  <a href="/docs/provisioners/shell.html">shell provisioner</a> before the
    22  Puppet provisioner to do this.
    23  </div>
    24  
    25  ## Basic Example
    26  
    27  The example below is fully functional and expects the configured manifest
    28  file to exist relative to your working directory:
    29  
    30  <pre class="prettyprint">
    31  {
    32    "type": "puppet-masterless",
    33    "manifest_file": "site.pp"
    34  }
    35  </pre>
    36  
    37  ## Configuration Reference
    38  
    39  The reference of available configuration options is listed below.
    40  
    41  Required parameters:
    42  
    43  * `manifest_file` (string) - The manifest file for Puppet to use in order
    44    to compile and run a catalog. This file must exist on your local system
    45    and will be uploaded to the remote machine.
    46  
    47  Optional parameters:
    48  
    49  * `execute_command` (string) - The command used to execute Puppet. This has
    50    various [configuration template variables](/docs/templates/configuration-templates.html)
    51    available. See below for more information.
    52  
    53  * `facter` (object, string keys and values) - Additonal
    54    [facts](http://puppetlabs.com/puppet/related-projects/facter) to make
    55    available when Puppet is running.
    56  
    57  * `hiera_config_path` (string) - The path to a local file with hiera
    58    configuration to be uploaded to the remote machine. Hiera data directories
    59    must be uploaded using the file provisioner separately.
    60  
    61  * `module_paths` (array of strings) - This is an array of paths to module
    62    directories on your local filesystem. These will be uploaded to the remote
    63    machine. By default, this is empty.
    64  
    65  * `prevent_sudo` (boolean) - By default, the configured commands that are
    66    executed to run Puppet are executed with `sudo`. If this is true,
    67    then the sudo will be omitted.
    68  
    69  * `staging_directory` (string) - This is the directory where all the configuration
    70    of Puppet by Packer will be placed. By default this is "/tmp/packer-puppet-masterless".
    71    This directory doesn't need to exist but must have proper permissions so that
    72    the SSH user that Packer uses is able to create directories and write into
    73    this folder. If the permissions are not correct, use a shell provisioner
    74    prior to this to configure it properly.
    75  
    76  ## Execute Command
    77  
    78  By default, Packer uses the following command (broken across multiple lines
    79  for readability) to execute Puppet:
    80  
    81  ```
    82  {{.FacterVars}}{{if .Sudo} sudo -E {{end}}puppet apply \
    83    --verbose \
    84    --modulepath='{{.ModulePath}}' \
    85    {{if .HasHieraConfigPath}}--hiera_config='{{.HieraConfigPath}}' {{end}} \
    86    {{.ManifestFile}}
    87  ```
    88  
    89  This command can be customized using the `execute_command` configuration.
    90  As you can see from the default value above, the value of this configuration
    91  can contain various template variables, defined below:
    92  
    93  * `FacterVars` - Shell-friendly string of environmental variables used
    94    to set custom facts configured for this provisioner.
    95  * `HasHieraConfigPath` - Boolean true if there is a hiera config path set.
    96  * `HieraConfigPath` - The path to a hiera configuration file.
    97  * `ManifestFile` - The path on the remote machine to the manifest file
    98    for Puppet to use.
    99  * `ModulePath` - The paths to the module directories.
   100  * `Sudo` - A boolean of whether to `sudo` the command or not, depending on
   101    the value of the `prevent_sudo` configuration.
   102