formatting
This commit is contained in:
parent
bc8e5d2c41
commit
fd6415ddf5
|
@ -41,19 +41,19 @@ type Provisioner struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConfigTemplate struct {
|
type ConfigTemplate struct {
|
||||||
CookbookPaths string
|
CookbookPaths string
|
||||||
DataBagsPath string
|
DataBagsPath string
|
||||||
RolesPath string
|
RolesPath string
|
||||||
EnvironmentsPath string
|
EnvironmentsPath string
|
||||||
ChefEnvironment string
|
ChefEnvironment string
|
||||||
|
|
||||||
// Templates don't support boolean statements until Go 1.2. In the
|
// Templates don't support boolean statements until Go 1.2. In the
|
||||||
// mean time, we do this.
|
// mean time, we do this.
|
||||||
// TODO(mitchellh): Remove when Go 1.2 is released
|
// TODO(mitchellh): Remove when Go 1.2 is released
|
||||||
HasDataBagsPath bool
|
HasDataBagsPath bool
|
||||||
HasRolesPath bool
|
HasRolesPath bool
|
||||||
HasEnvironmentsPath bool
|
HasEnvironmentsPath bool
|
||||||
HasChefEnvironment bool
|
HasChefEnvironment bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExecuteTemplate struct {
|
type ExecuteTemplate struct {
|
||||||
|
@ -98,12 +98,12 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
|
||||||
errs := common.CheckUnusedConfig(md)
|
errs := common.CheckUnusedConfig(md)
|
||||||
|
|
||||||
templates := map[string]*string{
|
templates := map[string]*string{
|
||||||
"config_template": &p.config.ConfigTemplate,
|
"config_template": &p.config.ConfigTemplate,
|
||||||
"data_bags_path": &p.config.DataBagsPath,
|
"data_bags_path": &p.config.DataBagsPath,
|
||||||
"roles_path": &p.config.RolesPath,
|
"roles_path": &p.config.RolesPath,
|
||||||
"staging_dir": &p.config.StagingDir,
|
"staging_dir": &p.config.StagingDir,
|
||||||
"environments_path": &p.config.EnvironmentsPath,
|
"environments_path": &p.config.EnvironmentsPath,
|
||||||
"chef_environment": &p.config.ChefEnvironment,
|
"chef_environment": &p.config.ChefEnvironment,
|
||||||
}
|
}
|
||||||
|
|
||||||
for n, ptr := range templates {
|
for n, ptr := range templates {
|
||||||
|
@ -319,14 +319,14 @@ func (p *Provisioner) createConfig(ui packer.Ui, comm packer.Communicator, local
|
||||||
}
|
}
|
||||||
|
|
||||||
configString, err := p.config.tpl.Process(tpl, &ConfigTemplate{
|
configString, err := p.config.tpl.Process(tpl, &ConfigTemplate{
|
||||||
CookbookPaths: strings.Join(cookbook_paths, ","),
|
CookbookPaths: strings.Join(cookbook_paths, ","),
|
||||||
RolesPath: rolesPath,
|
RolesPath: rolesPath,
|
||||||
DataBagsPath: dataBagsPath,
|
DataBagsPath: dataBagsPath,
|
||||||
EnvironmentsPath: environmentsPath,
|
EnvironmentsPath: environmentsPath,
|
||||||
HasRolesPath: rolesPath != "",
|
HasRolesPath: rolesPath != "",
|
||||||
HasDataBagsPath: dataBagsPath != "",
|
HasDataBagsPath: dataBagsPath != "",
|
||||||
HasEnvironmentsPath: environmentsPath != "",
|
HasEnvironmentsPath: environmentsPath != "",
|
||||||
ChefEnvironment: chefEnvironment,
|
ChefEnvironment: chefEnvironment,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
Loading…
Reference in New Issue