|
|
|
|
@ -43,6 +43,7 @@ type Config struct {
|
|
|
|
|
NICs []nicConfig `mapstructure:"network_adapters"`
|
|
|
|
|
Disks []diskConfig `mapstructure:"disks"`
|
|
|
|
|
ISOFile string `mapstructure:"iso_file"`
|
|
|
|
|
Agent string `mapstructure:"qemu_agent"`
|
|
|
|
|
|
|
|
|
|
TemplateName string `mapstructure:"template_name"`
|
|
|
|
|
TemplateDescription string `mapstructure:"template_description"`
|
|
|
|
|
@ -149,6 +150,11 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
|
|
|
|
|
c.Disks[idx].CacheMode = "none"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Valid values: 0 - no agent, 1 - with agent; default is 1
|
|
|
|
|
if c.Agent != "0" && c.Agent != "1" {
|
|
|
|
|
log.Printf("Agent '%s' is not valid, using default: 1", c.Agent)
|
|
|
|
|
c.Agent = "1"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errs = packer.MultiErrorAppend(errs, c.Comm.Prepare(&c.ctx)...)
|
|
|
|
|
errs = packer.MultiErrorAppend(errs, c.BootConfig.Prepare(&c.ctx)...)
|
|
|
|
|
|