diff --git a/CHANGELOG.md b/CHANGELOG.md index 2602d3c70..ed20fbe25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## 0.5.0 (unreleased) +BACKWARDS INCOMPATIBILITIES: + +* provisioner/puppet-masterless: The `execute_command` no longer has + the `Has*` variables, since the templating language now supports + comparison operations. See the Go documentation for more info: + http://golang.org/pkg/text/template/ + IMPROVEMENTS: * core: Plugins communicate over a single TCP connection per plugin now, diff --git a/provisioner/puppet-masterless/provisioner.go b/provisioner/puppet-masterless/provisioner.go index e3dd4dd77..dd5f00f5c 100644 --- a/provisioner/puppet-masterless/provisioner.go +++ b/provisioner/puppet-masterless/provisioner.go @@ -49,11 +49,9 @@ type Provisioner struct { type ExecuteTemplate struct { FacterVars string - HasHieraConfigPath bool HieraConfigPath string ModulePath string ManifestFile string - HasManifestDir bool ManifestDir string Sudo bool } @@ -77,8 +75,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = "{{.FacterVars}} {{if .Sudo}} sudo -E {{end}}" + "puppet apply --verbose --modulepath='{{.ModulePath}}' " + - "{{if .HasHieraConfigPath}}--hiera_config='{{.HieraConfigPath}}' {{end}}" + - "{{if .HasManifestDir}}--manifestdir='{{.ManifestDir}}' {{end}}" + + "{{if .HieraConfigPath ne ""}}--hiera_config='{{.HieraConfigPath}}' {{end}}" + + "{{if .ManifestDir ne ""}}--manifestdir='{{.ManifestDir}}' {{end}}" + "--detailed-exitcodes " + "{{.ManifestFile}}" } @@ -262,9 +260,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { // Execute Puppet command, err := p.config.tpl.Process(p.config.ExecuteCommand, &ExecuteTemplate{ FacterVars: strings.Join(facterVars, " "), - HasHieraConfigPath: remoteHieraConfigPath != "", HieraConfigPath: remoteHieraConfigPath, - HasManifestDir: remoteManifestDir != "", ManifestDir: remoteManifestDir, ManifestFile: remoteManifestFile, ModulePath: strings.Join(modulePaths, ":"),