From bc2e3de06dd959845f69270bc22894b71bb2a851 Mon Sep 17 00:00:00 2001 From: c22 Date: Tue, 15 Aug 2017 13:01:24 +1000 Subject: [PATCH] Resolve merge conflicts and update documentation. --- provisioner/puppet-masterless/provisioner.go | 10 ++-- provisioner/puppet-server/provisioner.go | 10 ++-- .../provisioners/puppet-masterless.html.md | 4 +- .../docs/provisioners/puppet-server.html.md | 48 ++++++++++++++----- 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/provisioner/puppet-masterless/provisioner.go b/provisioner/puppet-masterless/provisioner.go index e64e5f7dd..1f2c5bb96 100644 --- a/provisioner/puppet-masterless/provisioner.go +++ b/provisioner/puppet-masterless/provisioner.go @@ -9,11 +9,11 @@ import ( "path/filepath" "strings" - "github.com/mitchellh/packer/common" - "github.com/mitchellh/packer/helper/config" - "github.com/mitchellh/packer/packer" - "github.com/mitchellh/packer/provisioner" - "github.com/mitchellh/packer/template/interpolate" + "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/packer" + "github.com/hashicorp/packer/provisioner" + "github.com/hashicorp/packer/template/interpolate" ) type Config struct { diff --git a/provisioner/puppet-server/provisioner.go b/provisioner/puppet-server/provisioner.go index 0c8babab1..4da3ecbc6 100644 --- a/provisioner/puppet-server/provisioner.go +++ b/provisioner/puppet-server/provisioner.go @@ -7,11 +7,11 @@ import ( "os" "strings" - "github.com/mitchellh/packer/common" - "github.com/mitchellh/packer/helper/config" - "github.com/mitchellh/packer/packer" - "github.com/mitchellh/packer/provisioner" - "github.com/mitchellh/packer/template/interpolate" + "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/packer" + "github.com/hashicorp/packer/provisioner" + "github.com/hashicorp/packer/template/interpolate" ) type guestOSTypeConfig struct { diff --git a/website/source/docs/provisioners/puppet-masterless.html.md b/website/source/docs/provisioners/puppet-masterless.html.md index 4d697ecce..b58d78251 100644 --- a/website/source/docs/provisioners/puppet-masterless.html.md +++ b/website/source/docs/provisioners/puppet-masterless.html.md @@ -105,7 +105,7 @@ multiple manifests you should use `manifest_file` instead. - `staging_directory` (string) - This is the directory where all the configuration of Puppet by Packer will be placed. By default this is "/tmp/packer-puppet-masterless" - when guest_os_type unix and "C:/Windows/Temp/packer-puppet-masterless" when windows. + when guest OS type is unix and "C:/Windows/Temp/packer-puppet-masterless" 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 @@ -133,7 +133,7 @@ puppet apply --verbose --modulepath='{{.ModulePath}}' {{.ManifestFile}} ``` -The following command is used if guest_os_type is windows: +The following command is used if guest OS type is windows: ``` cd {{.WorkingDir}} && diff --git a/website/source/docs/provisioners/puppet-server.html.md b/website/source/docs/provisioners/puppet-server.html.md index b81d49088..6adfd6b0b 100644 --- a/website/source/docs/provisioners/puppet-server.html.md +++ b/website/source/docs/provisioners/puppet-server.html.md @@ -69,28 +69,52 @@ listed below: - `puppet_server` (string) - Hostname of the Puppet server. By default "puppet" will be used. -- `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. +- `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. 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. - `puppet_bin_dir` (string) - The path to the directory that contains the puppet 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. -- `execute_command` (string) - This is optional. The command used to execute Puppet. This has - various [configuration template - 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". +- `execute_command` (string) - This is optional. The command used to execute Puppet. This has + various [configuration template variables](/docs/templates/engine.html) available. By default, + Packer uses the following command (broken across multiple lines for readability) to execute Puppet: + +``` +{{.FacterVars}} {{if .Sudo}}sudo -E {{end}} +{{if ne .PuppetBinDir ""}}{{.PuppetBinDir}}/{{end}}puppet agent +--onetime --no-daemonize +{{if ne .PuppetServer ""}}--server='{{.PuppetServer}}' {{end}} +{{if ne .Options ""}}{{.Options}} {{end}} +{{if ne .PuppetNode ""}}--certname={{.PuppetNode}} {{end}} +{{if ne .ClientCertPath ""}}--certdir='{{.ClientCertPath}}' {{end}} +{{if ne .ClientPrivateKeyPath ""}}--privatekeydir='{{.ClientPrivateKeyPath}}' {{end}} +--detailed-exitcodes +``` + +The following command is used if guest OS type is windows: + +``` +{{.FacterVars}} +{{if ne .PuppetBinDir ""}}{{.PuppetBinDir}}/{{end}}puppet agent +--onetime --no-daemonize +{{if ne .PuppetServer ""}}--server='{{.PuppetServer}}' {{end}} +{{if ne .Options ""}}{{.Options}} {{end}} +{{if ne .PuppetNode ""}}--certname={{.PuppetNode}} {{end}} +{{if ne .ClientCertPath ""}}--certdir='{{.ClientCertPath}}' {{end}} +{{if ne .ClientPrivateKeyPath ""}}--privatekeydir='{{.ClientPrivateKeyPath}}' {{end}} +--detailed-exitcodes +``` + ## Default Facts In addition to being able to specify custom Facter facts using the `facter`