Commit a0664c7e authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/vmware: Ability to set the guest OS type

parent 09db84eb
...@@ -23,6 +23,7 @@ type Builder struct { ...@@ -23,6 +23,7 @@ type Builder struct {
type config struct { type config struct {
DiskName string `mapstructure:"vmdk_name"` DiskName string `mapstructure:"vmdk_name"`
GuestOSType string `mapstructure:"guest_os_type"`
ISOUrl string `mapstructure:"iso_url"` ISOUrl string `mapstructure:"iso_url"`
VMName string `mapstructure:"vm_name"` VMName string `mapstructure:"vm_name"`
OutputDir string `mapstructure:"output_directory"` OutputDir string `mapstructure:"output_directory"`
...@@ -55,6 +56,10 @@ func (b *Builder) Prepare(raw interface{}) (err error) { ...@@ -55,6 +56,10 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
b.config.DiskName = "disk" b.config.DiskName = "disk"
} }
if b.config.GuestOSType == "" {
b.config.GuestOSType = "other"
}
if b.config.VMName == "" { if b.config.VMName == "" {
b.config.VMName = "packer" b.config.VMName = "packer"
} }
......
...@@ -35,7 +35,7 @@ func (stepCreateVMX) Run(state map[string]interface{}) multistep.StepAction { ...@@ -35,7 +35,7 @@ func (stepCreateVMX) Run(state map[string]interface{}) multistep.StepAction {
tplData := &vmxTemplateData{ tplData := &vmxTemplateData{
config.VMName, config.VMName,
"ubuntu-64", config.GuestOSType,
config.DiskName, config.DiskName,
config.ISOUrl, config.ISOUrl,
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment