|
|
|
|
@ -57,9 +57,6 @@ type Config struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
|
|
|
|
// Set some defaults
|
|
|
|
|
b.config.VMName = fmt.Sprintf("packer-%s-{{timestamp}}", b.config.PackerBuildName)
|
|
|
|
|
|
|
|
|
|
err := config.Decode(&b.config, &config.DecodeOpts{
|
|
|
|
|
Interpolate: true,
|
|
|
|
|
InterpolateContext: &b.config.ctx,
|
|
|
|
|
@ -116,6 +113,11 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
|
|
|
|
b.config.ISOInterface = "ide"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if b.config.VMName == "" {
|
|
|
|
|
b.config.VMName = fmt.Sprintf(
|
|
|
|
|
"packer-%s-%d", b.config.PackerBuildName, interpolate.InitTime.Unix())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if b.config.HardDriveInterface != "ide" && b.config.HardDriveInterface != "sata" && b.config.HardDriveInterface != "scsi" {
|
|
|
|
|
errs = packer.MultiErrorAppend(
|
|
|
|
|
errs, errors.New("hard_drive_interface can only be ide, sata, or scsi"))
|
|
|
|
|
|