Added struct to be passed to the Process function to render the vagrant file path. Resolves Issue #1125.

pull/1514/head
Brian Downs 12 years ago
parent 5e4ffb56d0
commit 1303329a91

@ -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
}

Loading…
Cancel
Save