builder/vmware: Ability to set the guest OS type

This commit is contained in:
Mitchell Hashimoto 2013-06-07 21:54:08 -07:00
parent 09db84eb5e
commit a0664c7ec8
2 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,7 @@ type Builder struct {
type config struct {
DiskName string `mapstructure:"vmdk_name"`
GuestOSType string `mapstructure:"guest_os_type"`
ISOUrl string `mapstructure:"iso_url"`
VMName string `mapstructure:"vm_name"`
OutputDir string `mapstructure:"output_directory"`
@ -55,6 +56,10 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
b.config.DiskName = "disk"
}
if b.config.GuestOSType == "" {
b.config.GuestOSType = "other"
}
if b.config.VMName == "" {
b.config.VMName = "packer"
}

View File

@ -35,7 +35,7 @@ func (stepCreateVMX) Run(state map[string]interface{}) multistep.StepAction {
tplData := &vmxTemplateData{
config.VMName,
"ubuntu-64",
config.GuestOSType,
config.DiskName,
config.ISOUrl,
}