Adding new "Options" configuration parameter for
the puppet-masterless provisioner, to allow for specifying additional options to pass to the execute command
This commit is contained in:
parent
70e7e953b1
commit
ebed9e53fb
|
@ -22,6 +22,9 @@ type Config struct {
|
|||
// The command used to execute Puppet.
|
||||
ExecuteCommand string `mapstructure:"execute_command"`
|
||||
|
||||
// Additional options to pass when executing Puppet
|
||||
Options []string
|
||||
|
||||
// Additional facts to set when executing Puppet
|
||||
Facter map[string]string
|
||||
|
||||
|
@ -62,6 +65,7 @@ type ExecuteTemplate struct {
|
|||
ManifestFile string
|
||||
ManifestDir string
|
||||
Sudo bool
|
||||
Options string
|
||||
}
|
||||
|
||||
func (p *Provisioner) Prepare(raws ...interface{}) error {
|
||||
|
@ -86,6 +90,7 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
|
|||
"{{if ne .HieraConfigPath \"\"}}--hiera_config='{{.HieraConfigPath}}' {{end}}" +
|
||||
"{{if ne .ManifestDir \"\"}}--manifestdir='{{.ManifestDir}}' {{end}}" +
|
||||
"--detailed-exitcodes " +
|
||||
"{{.Options}} " +
|
||||
"{{.ManifestFile}}"
|
||||
}
|
||||
|
||||
|
@ -218,6 +223,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
|
|||
ModulePath: strings.Join(modulePaths, ":"),
|
||||
Sudo: !p.config.PreventSudo,
|
||||
WorkingDir: p.config.WorkingDir,
|
||||
Options: strings.Join(p.config.Options, " "),
|
||||
}
|
||||
command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue