diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 71f86e553..7acea7daf 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -259,7 +259,7 @@ does not attempt to track the latest version for each dependency. #### Code generation Packer relies on `go generate` to generate a [peg parser for boot -commands](https://github.com/hashicorp/packer/blob/master/common/bootcommand/boot_command.go), +commands](https://github.com/hashicorp/packer/blob/master/packer-plugin-sdk/bootcommand/boot_command.go), [docs](https://github.com/hashicorp/packer/blob/master/website/pages/partials/builder/amazon/chroot/_Config-not-required.mdx) and HCL2's bridging code. Packer's testing suite will run `make check-generate` to check that all the generated files Packer needs are what they should be. diff --git a/Makefile b/Makefile index 589dde035..f4d375843 100644 --- a/Makefile +++ b/Makefile @@ -123,9 +123,9 @@ generate: install-gen-deps ## Generate dynamically generated code @echo "==> removing autogenerated markdown..." @find website/pages/ -type f | xargs grep -l '^ + - `boot_keygroup_interval` (duration string | ex: "1h5m2s") - Time to wait after sending a group of key pressses. The value of this should be a duration. Examples are `5s` and `1m30s` which will cause diff --git a/website/pages/partials/common/bootcommand/BootConfig.mdx b/website/pages/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx similarity index 98% rename from website/pages/partials/common/bootcommand/BootConfig.mdx rename to website/pages/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx index f8115899c..8d41f834f 100644 --- a/website/pages/partials/common/bootcommand/BootConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx @@ -1,4 +1,4 @@ - + The boot configuration is very important: `boot_command` specifies the keys to type when the virtual machine is first booted in order to start the OS diff --git a/website/pages/partials/common/bootcommand/VNCConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx similarity index 81% rename from website/pages/partials/common/bootcommand/VNCConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx index 6c532fd4f..008fdb54a 100644 --- a/website/pages/partials/common/bootcommand/VNCConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `disable_vnc` (bool) - Whether to create a VNC connection or not. A boot_command cannot be used when this is true. Defaults to false. diff --git a/website/pages/partials/common/bootcommand/VNCConfig.mdx b/website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx similarity index 87% rename from website/pages/partials/common/bootcommand/VNCConfig.mdx rename to website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx index 34a6748ac..f539a6590 100644 --- a/website/pages/partials/common/bootcommand/VNCConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx @@ -1,4 +1,4 @@ - + The boot command "typed" character for character over a VNC connection to the machine, simulating a human actually typing the keyboard. diff --git a/website/pages/partials/common/commonsteps/CDConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig-not-required.mdx similarity index 95% rename from website/pages/partials/common/commonsteps/CDConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig-not-required.mdx index 9fc2cdc23..9486e4f03 100644 --- a/website/pages/partials/common/commonsteps/CDConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `cd_files` ([]string) - A list of files to place onto a CD that is attached when the VM is booted. This can include either files or directories; any directories diff --git a/website/pages/partials/common/commonsteps/CDConfig.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig.mdx similarity index 86% rename from website/pages/partials/common/commonsteps/CDConfig.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig.mdx index a139db6a4..e861c99f0 100644 --- a/website/pages/partials/common/commonsteps/CDConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig.mdx @@ -1,4 +1,4 @@ - + An iso (CD) containing custom files can be made available for your build. diff --git a/website/pages/partials/common/commonsteps/FloppyConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig-not-required.mdx similarity index 92% rename from website/pages/partials/common/commonsteps/FloppyConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig-not-required.mdx index c81d3f61f..c261f96e2 100644 --- a/website/pages/partials/common/commonsteps/FloppyConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `floppy_files` ([]string) - A list of files to place onto a floppy disk that is attached when the VM is booted. Currently, no support exists for creating sub-directories on diff --git a/website/pages/partials/common/commonsteps/FloppyConfig.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig.mdx similarity index 88% rename from website/pages/partials/common/commonsteps/FloppyConfig.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig.mdx index 8db59da19..a6474cf6e 100644 --- a/website/pages/partials/common/commonsteps/FloppyConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig.mdx @@ -1,4 +1,4 @@ - + A floppy can be made available for your build. This is most useful for unattended Windows installs, which look for an Autounattend.xml file on diff --git a/website/pages/partials/common/commonsteps/HTTPConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig-not-required.mdx similarity index 93% rename from website/pages/partials/common/commonsteps/HTTPConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig-not-required.mdx index aece4b6de..82bf23690 100644 --- a/website/pages/partials/common/commonsteps/HTTPConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `http_directory` (string) - Path to a directory to serve using an HTTP server. The files in this directory will be available over HTTP that will be requestable from the diff --git a/website/pages/partials/common/commonsteps/HTTPConfig.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig.mdx similarity index 83% rename from website/pages/partials/common/commonsteps/HTTPConfig.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig.mdx index f841432a8..8fad89d65 100644 --- a/website/pages/partials/common/commonsteps/HTTPConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig.mdx @@ -1,4 +1,4 @@ - + Packer will create an http server serving `http_directory` when it is set, a random free port will be selected and the architecture of the directory diff --git a/website/pages/partials/common/commonsteps/ISOConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-not-required.mdx similarity index 91% rename from website/pages/partials/common/commonsteps/ISOConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-not-required.mdx index 9d0744786..60e976cbb 100644 --- a/website/pages/partials/common/commonsteps/ISOConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `iso_urls` ([]string) - Multiple URLs for the ISO to download. Packer will try these in order. If anything goes wrong attempting to download or while downloading a diff --git a/website/pages/partials/common/commonsteps/ISOConfig-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-required.mdx similarity index 94% rename from website/pages/partials/common/commonsteps/ISOConfig-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-required.mdx index a2c27df83..5e6624577 100644 --- a/website/pages/partials/common/commonsteps/ISOConfig-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-required.mdx @@ -1,4 +1,4 @@ - + - `iso_checksum` (string) - The checksum for the ISO file or virtual hard drive file. The type of the checksum is specified within the checksum field as a prefix, ex: diff --git a/website/pages/partials/common/commonsteps/ISOConfig.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig.mdx similarity index 95% rename from website/pages/partials/common/commonsteps/ISOConfig.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig.mdx index 548bffa0b..5e55a847e 100644 --- a/website/pages/partials/common/commonsteps/ISOConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig.mdx @@ -1,4 +1,4 @@ - + By default, Packer will symlink, download or copy image files to the Packer cache into a "`hash($iso_url+$iso_checksum).$iso_target_extension`" file. diff --git a/website/pages/partials/common/shutdowncommand/ShutdownConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx similarity index 92% rename from website/pages/partials/common/shutdowncommand/ShutdownConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx index 2b705dd61..0cd262f0d 100644 --- a/website/pages/partials/common/shutdowncommand/ShutdownConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `shutdown_command` (string) - The command to use to gracefully shut down the machine once all provisioning is complete. By default this is an empty string, which diff --git a/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx b/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx new file mode 100644 index 000000000..e958c8ca3 --- /dev/null +++ b/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx @@ -0,0 +1,9 @@ + + +ShutdownConfig defines implementation details for shutting down a VM once it +is done provisioned. +It is provided as a convenience to encourage builder developers to +consider implementing these options, which we believe are valuable for all +builders. It also helps guarantee that option names for similar options +are the same across the various builders. Embed it in your builder config +using the `mapstructure:",squash"` struct tag.