provisioner/chef-solo: template doesn't support comp [GH-442]
This commit is contained in:
parent
30eccf4130
commit
3732d6863a
|
@ -42,6 +42,12 @@ type ConfigTemplate struct {
|
||||||
CookbookPaths string
|
CookbookPaths string
|
||||||
DataBagsPath string
|
DataBagsPath string
|
||||||
RolesPath string
|
RolesPath string
|
||||||
|
|
||||||
|
// Templates don't support boolean statements until Go 1.2. In the
|
||||||
|
// mean time, we do this.
|
||||||
|
// TODO(mitchellh): Remove when Go 1.2 is released
|
||||||
|
HasDataBagsPath bool
|
||||||
|
HasRolesPath bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExecuteTemplate struct {
|
type ExecuteTemplate struct {
|
||||||
|
@ -291,6 +297,8 @@ func (p *Provisioner) createConfig(ui packer.Ui, comm packer.Communicator, local
|
||||||
CookbookPaths: strings.Join(cookbook_paths, ","),
|
CookbookPaths: strings.Join(cookbook_paths, ","),
|
||||||
RolesPath: rolesPath,
|
RolesPath: rolesPath,
|
||||||
DataBagsPath: dataBagsPath,
|
DataBagsPath: dataBagsPath,
|
||||||
|
HasRolesPath: rolesPath != "",
|
||||||
|
HasDataBagsPath: dataBagsPath != "",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
@ -442,10 +450,10 @@ func (p *Provisioner) processJsonUserVars() (map[string]interface{}, error) {
|
||||||
|
|
||||||
var DefaultConfigTemplate = `
|
var DefaultConfigTemplate = `
|
||||||
cookbook_path [{{.CookbookPaths}}]
|
cookbook_path [{{.CookbookPaths}}]
|
||||||
{{if .RolesPath != ""}}
|
{{if .HasRolesPath}}
|
||||||
role_path "{{.RolesPath}}"
|
role_path "{{.RolesPath}}"
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .DataBagsPath != ""}}
|
{{if .HasDataBagsPath}}
|
||||||
data_bag_path "{{.DataBagsPath}}"
|
data_bag_path "{{.DataBagsPath}}"
|
||||||
{{end}}
|
{{end}}
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in New Issue