Commit 1303329a authored by Brian Downs's avatar Brian Downs

Added struct to be passed to the Process function to render the vagrant file...

Added struct to be passed to the Process function to render the vagrant file path.  Resolves Issue #1125.
parent 5e4ffb56
......@@ -125,9 +125,17 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
// Write our Vagrantfile
var customVagrantfile string
if config.VagrantfileTemplate != "" {
vagrantfilePath, err := config.tpl.Process(config.VagrantfileTemplate, &vagrantfileTemplate{
ProviderVagrantfile: vagrantfile,
CustomVagrantfile: "",
})
if err != nil {
return nil, false, err
}
ui.Message(fmt.Sprintf(
"Using custom Vagrantfile: %s", config.VagrantfileTemplate))
customBytes, err := ioutil.ReadFile(config.VagrantfileTemplate)
"Using custom Vagrantfile: %s", vagrantfilePath))
customBytes, err := ioutil.ReadFile(vagrantfilePath)
if err != nil {
return nil, false, err
}
......
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