Add option to allow box Vagrantfile to be dynamically generated during build
This commit is contained in:
parent
19f3a63ee1
commit
1bffdd9bff
|
@ -47,6 +47,7 @@ type Config struct {
|
|||
OutputPath string `mapstructure:"output"`
|
||||
Override map[string]interface{}
|
||||
VagrantfileTemplate string `mapstructure:"vagrantfile_template"`
|
||||
VagrantfileTemplateGenerated bool `mapstructure:"vagrantfile_template_generated"`
|
||||
|
||||
ctx interpolate.Context
|
||||
}
|
||||
|
@ -217,7 +218,7 @@ func (p *PostProcessor) configureSingle(c *Config, raws ...interface{}) error {
|
|||
}
|
||||
|
||||
var errs *packer.MultiError
|
||||
if c.VagrantfileTemplate != "" {
|
||||
if c.VagrantfileTemplate != "" && c.VagrantfileTemplateGenerated == false {
|
||||
_, err := os.Stat(c.VagrantfileTemplate)
|
||||
if err != nil {
|
||||
errs = packer.MultiErrorAppend(errs, fmt.Errorf(
|
||||
|
|
Loading…
Reference in New Issue