diff --git a/builder/vsphere/iso/step_remove_cdrom.go b/builder/vsphere/iso/step_remove_cdrom.go index 9fd3075a4..508676575 100644 --- a/builder/vsphere/iso/step_remove_cdrom.go +++ b/builder/vsphere/iso/step_remove_cdrom.go @@ -1,3 +1,6 @@ +//go:generate struct-markdown +//go:generate mapstructure-to-hcl2 -type RemoveCDRomConfig + package iso import ( @@ -8,6 +11,7 @@ import ( ) type RemoveCDRomConfig struct { + // Remove CD-ROM devices from template. Defaults to `false`. RemoveCdrom bool `mapstructure:"remove_cdrom"` } diff --git a/builder/vsphere/iso/step_remove_cdrom.hcl2spec.go b/builder/vsphere/iso/step_remove_cdrom.hcl2spec.go new file mode 100644 index 000000000..a8c2303cf --- /dev/null +++ b/builder/vsphere/iso/step_remove_cdrom.hcl2spec.go @@ -0,0 +1,30 @@ +// Code generated by "mapstructure-to-hcl2 -type RemoveCDRomConfig"; DO NOT EDIT. +package iso + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatRemoveCDRomConfig is an auto-generated flat version of RemoveCDRomConfig. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatRemoveCDRomConfig struct { + RemoveCdrom *bool `mapstructure:"remove_cdrom" cty:"remove_cdrom"` +} + +// FlatMapstructure returns a new FlatRemoveCDRomConfig. +// FlatRemoveCDRomConfig is an auto-generated flat version of RemoveCDRomConfig. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*RemoveCDRomConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatRemoveCDRomConfig) +} + +// HCL2Spec returns the hcl spec of a RemoveCDRomConfig. +// This spec is used by HCL to read the fields of RemoveCDRomConfig. +// The decoded values from this spec will then be applied to a FlatRemoveCDRomConfig. +func (*FlatRemoveCDRomConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "remove_cdrom": &hcldec.AttrSpec{Name: "remove_cdrom", Type: cty.Bool, Required: false}, + } + return s +} diff --git a/website/source/partials/builder/vsphere/iso/_CDRomConfig-not-required.html.md b/website/source/partials/builder/vsphere/iso/_CDRomConfig-not-required.html.md index ed50e4461..e3952b792 100644 --- a/website/source/partials/builder/vsphere/iso/_CDRomConfig-not-required.html.md +++ b/website/source/partials/builder/vsphere/iso/_CDRomConfig-not-required.html.md @@ -2,8 +2,6 @@ - `cdrom_type` (string) - Which controller to use. Example: `sata`. Defaults to `ide`. -- `remove_cdrom` (boolean) - Remove CD/DVD-ROM devices from template. Defaults to `false`. - - `iso_paths` ([]string) - List of datastore paths to ISO files that will be mounted to the VM. Example: `"[datastore1] ISO/ubuntu.iso"`. - + \ No newline at end of file diff --git a/website/source/partials/builder/vsphere/iso/_RemoveCDRomConfig-not-required.html.md b/website/source/partials/builder/vsphere/iso/_RemoveCDRomConfig-not-required.html.md new file mode 100644 index 000000000..a01290e7e --- /dev/null +++ b/website/source/partials/builder/vsphere/iso/_RemoveCDRomConfig-not-required.html.md @@ -0,0 +1,4 @@ + + +- `remove_cdrom` (bool) - Remove CD-ROM devices from template. Defaults to `false`. + \ No newline at end of file