Commit e8d1cc8e authored by Sudharshan S's avatar Sudharshan S

Fix Puppet Provisioner crash when HieraConfigPath or ManifestDir is specified

Prevents the following error,
Build 'amazon-instance' errored: template: tpl11:1:103: executing "tpl11" at <.HieraConfigPath>: HieraConfigPath has arguments but cannot be invoked as function
parent f99837b4
...@@ -75,8 +75,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { ...@@ -75,8 +75,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
if p.config.ExecuteCommand == "" { if p.config.ExecuteCommand == "" {
p.config.ExecuteCommand = "{{.FacterVars}} {{if .Sudo}} sudo -E {{end}}" + p.config.ExecuteCommand = "{{.FacterVars}} {{if .Sudo}} sudo -E {{end}}" +
"puppet apply --verbose --modulepath='{{.ModulePath}}' " + "puppet apply --verbose --modulepath='{{.ModulePath}}' " +
"{{if .HieraConfigPath ne \"\"}}--hiera_config='{{.HieraConfigPath}}' {{end}}" + "{{if ne .HieraConfigPath \"\"}}--hiera_config='{{.HieraConfigPath}}' {{end}}" +
"{{if .ManifestDir ne \"\"}}--manifestdir='{{.ManifestDir}}' {{end}}" + "{{if ne .ManifestDir \"\"}}--manifestdir='{{.ManifestDir}}' {{end}}" +
"--detailed-exitcodes " + "--detailed-exitcodes " +
"{{.ManifestFile}}" "{{.ManifestFile}}"
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment