2019-05-31 08:27:41 -04:00
|
|
|
//go:generate struct-markdown
|
|
|
|
|
2013-12-26 17:14:19 -05:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
2020-12-17 16:29:25 -05:00
|
|
|
"github.com/hashicorp/packer-plugin-sdk/template/interpolate"
|
2013-12-26 17:14:19 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type VMXConfig struct {
|
2019-05-28 11:50:58 -04:00
|
|
|
// Arbitrary key/values to enter
|
2019-06-06 10:29:25 -04:00
|
|
|
// into the virtual machine VMX file. This is for advanced users who want to
|
|
|
|
// set properties that aren't yet supported by the builder.
|
|
|
|
VMXData map[string]string `mapstructure:"vmx_data" required:"false"`
|
2019-05-28 11:50:58 -04:00
|
|
|
// Identical to vmx_data,
|
2019-06-06 10:29:25 -04:00
|
|
|
// except that it is run after the virtual machine is shutdown, and before the
|
|
|
|
// virtual machine is exported.
|
|
|
|
VMXDataPost map[string]string `mapstructure:"vmx_data_post" required:"false"`
|
2019-05-28 11:50:58 -04:00
|
|
|
// Remove all ethernet interfaces
|
2019-06-06 10:29:25 -04:00
|
|
|
// from the VMX file after building. This is for advanced users who understand
|
|
|
|
// the ramifications, but is useful for building Vagrant boxes since Vagrant
|
|
|
|
// will create ethernet interfaces when provisioning a box. Defaults to
|
|
|
|
// false.
|
|
|
|
VMXRemoveEthernet bool `mapstructure:"vmx_remove_ethernet_interfaces" required:"false"`
|
2019-05-28 11:50:58 -04:00
|
|
|
// The name that will appear in your vSphere client,
|
2019-06-06 10:29:25 -04:00
|
|
|
// and will be used for the vmx basename. This will override the "displayname"
|
|
|
|
// value in your vmx file. It will also override the "displayname" if you have
|
|
|
|
// set it in the "vmx_data" Packer option. This option is useful if you are
|
|
|
|
// chaining vmx builds and want to make sure that the display name of each step
|
|
|
|
// in the chain is unique.
|
|
|
|
VMXDisplayName string `mapstructure:"display_name" required:"false"`
|
2013-12-26 17:14:19 -05:00
|
|
|
}
|
|
|
|
|
2016-02-02 15:41:42 -05:00
|
|
|
func (c *VMXConfig) Prepare(ctx *interpolate.Context) []error {
|
2016-02-02 15:41:43 -05:00
|
|
|
return nil
|
2013-12-26 17:14:19 -05:00
|
|
|
}
|