Commit 525802e9 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

provisioner/ansible-local: templates for role, playbook paths [GH-749]

parent 77d0d63b
......@@ -66,6 +66,8 @@ BUG FIXES:
* builder/virtualbox: don't download guest additions if disabled. [GH-731]
* post-processor/vsphere: Uploads VM properly. [GH-694]
* post-processor/vsphere: Process user variables.
* provisioner/ansible-local: all configurations are processed as templates
[GH-749]
* provisioner/ansible-local: playbook paths are properly validated
as directories, not files. [GH-710]
* provisioner/chef-solo: Environments are recognized. [GH-726]
......
......@@ -54,7 +54,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
// Templates
templates := map[string]*string{
"staging_dir": &p.config.StagingDir,
"playbook_file": &p.config.PlaybookFile,
"staging_dir": &p.config.StagingDir,
}
for n, ptr := range templates {
......@@ -66,6 +67,22 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
}
}
sliceTemplates := map[string][]string{
"playbook_paths": p.config.PlaybookPaths,
"role_paths": p.config.RolePaths,
}
for n, slice := range sliceTemplates {
for i, elem := range slice {
var err error
slice[i], err = p.config.tpl.Process(elem, nil)
if err != nil {
errs = packer.MultiErrorAppend(
errs, fmt.Errorf("Error processing %s[%d]: %s", n, i, err))
}
}
}
// Validation
err = validateFileConfig(p.config.PlaybookFile, "playbook_file", true)
if err != nil {
......
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