make sure all documentation fields are there

* add missing `temporary_key_pair_name` field for alicloud
* add missing description to `vpc_filter` for aws
* add missing ssh communicator fields for aws
* add links for aws
* update vmware-vmx docs
* manually describe AMI Configuration section for ebsvolume
* display missing required ami_name field for aws
* add missing fields for docker
* add missing fields for openstack
This commit is contained in:
Adrien Delorme 2019-08-26 16:56:57 +02:00
parent 2db109d55b
commit 5517d41468
22 changed files with 189 additions and 103 deletions

View File

@ -29,12 +29,14 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
awscommon.AMIConfig `mapstructure:",squash"`
awscommon.AccessConfig `mapstructure:",squash"`
// Add one or more block device mappings to the AMI. If this field is
// populated, and you are building from an existing source image, the block
// device mappings in the source image will be overwritten. This means you
// must have a block device mapping entry for your root volume,
// `root_volume_size` and `root_device_name`. See the
// [BlockDevices](#block-devices-configuration) documentation for fields.
// Add one or more [block device
// mappings](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
// to the AMI. If this field is populated, and you are building from an
// existing source image, the block device mappings in the source image
// will be overwritten. This means you must have a block device mapping
// entry for your root volume, `root_volume_size` and `root_device_name`.
// See the [BlockDevices](#block-devices-configuration) documentation for
// fields.
AMIMappings BlockDevices `mapstructure:"ami_block_device_mappings" required:"false"`
// This is a list of devices to mount into the chroot environment. This
// configuration parameter requires some additional documentation which is

View File

@ -60,8 +60,10 @@ type AccessConfig struct {
// This allows skipping TLS
// verification of the AWS EC2 endpoint. The default is false.
InsecureSkipTLSVerify bool `mapstructure:"insecure_skip_tls_verify" required:"false"`
// The MFA TOTP code. This should probably be a user variable since it
// changes all the time.
// The MFA
// [TOTP](https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm)
// code. This should probably be a user variable since it changes all the
// time.
MFACode string `mapstructure:"mfa_code" required:"false"`
// The profile to use in the shared credentials file for
// AWS. See Amazon's documentation on [specifying

View File

@ -38,7 +38,9 @@ type BlockDevice struct {
// encrypted one.
Encrypted *bool `mapstructure:"encrypted" required:"false"`
// The number of I/O operations per second (IOPS) that the volume supports.
// See the documentation on IOPs for more information
// See the documentation on
// [IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
// for more information
IOPS int64 `mapstructure:"iops" required:"false"`
// Suppresses the specified device included in the block device mapping of
// the AMI.

View File

@ -299,9 +299,32 @@ type RunConfig struct {
// Path to a file that will be used for the user
// data when launching the instance.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// Filters used to populate the vpc_id field.
// vpc_id take precedence over this.
// Filters used to populate the `vpc_id` field.
// Example:
//
// ``` json
// {
// "vpc_filter": {
// "filters": {
// "tag:Class": "build",
// "isDefault": "false",
// "cidr": "/24"
// }
// }
// }
// ```
//
// This selects the VPC with tag `Class` with the value `build`, which is not
// the default VPC, and have a IPv4 CIDR block of `/24`. NOTE: This will fail
// unless *exactly* one VPC is returned.
//
// - `filters` (map of strings) - filters used to select a `vpc_id`. NOTE:
// This will fail unless *exactly* one VPC is returned. Any filter
// described in the docs for
// [DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html)
// is valid.
//
// `vpc_id` take precedence over this.
VpcFilter VpcFilterOptions `mapstructure:"vpc_filter" required:"false"`
// If launching into a VPC subnet, Packer needs the VPC ID
// in order to create a temporary security group within the VPC. Requires

View File

@ -35,8 +35,8 @@ type Config struct {
Commit bool `mapstructure:"commit" required:"true"`
// The directory inside container to mount temp directory from host server
// for work file provisioner. This defaults to c:/packer-files on windows
// and /packer-files on other systems.
// for work [file provisioner](/docs/provisioners/file.html). This defaults
// to c:/packer-files on windows and /packer-files on other systems.
ContainerDir string `mapstructure:"container_dir" required:"false"`
// Throw away the container when the build is complete. This is useful for
// the [artifice

View File

@ -29,9 +29,19 @@ type Config struct {
vmwcommon.ToolsConfig `mapstructure:",squash"`
vmwcommon.VMXConfig `mapstructure:",squash"`
vmwcommon.ExportConfig `mapstructure:",squash"`
// By default Packer creates a 'full' clone of
// the virtual machine specified in source_path. The resultant virtual
// machine is fully independant from the parent it was cloned from.
// By default Packer creates a 'full' clone of the virtual machine
// specified in source_path. The resultant virtual machine is fully
// independant from the parent it was cloned from.
//
// Setting linked to true instead causes Packer to create the virtual
// machine as a 'linked' clone. Linked clones use and require ongoing
// access to the disks of the parent virtual machine. The benefit of a
// linked clone is that the clones virtual disk is typically very much
// smaller than would be the case for a full clone. Additionally, the
// cloned virtual machine can also be created much faster. Creating a
// linked clone will typically only be of benefit in some advanced build
// scenarios. Most users will wish to create a full clone instead. Defaults
// to false.
Linked bool `mapstructure:"linked" required:"false"`
// The type of remote machine that will be used to
// build this VM rather than a local desktop product. The only value accepted

View File

@ -81,7 +81,10 @@ type SSH struct {
// [`ssh_private_key_file`](../templates/communicator.html#ssh_private_key_file)
// or `ssh_agent_auth` must be specified when `ssh_keypair_name` is
// utilized.
SSHKeyPairName string `mapstructure:"ssh_keypair_name"`
SSHKeyPairName string `mapstructure:"ssh_keypair_name"`
// The name of the temporary key pair to generate. By default, Packer
// generates a name that looks like `packer_<UUID>`, where &lt;UUID&gt; is
// a 36 character unique identifier.
SSHTemporaryKeyPairName string `mapstructure:"temporary_key_pair_name"`
// If true, Packer will attempt to remove its temporary key from
// `~/.ssh/authorized_keys` and `/root/.ssh/authorized_keys`. This is a

View File

@ -35,6 +35,9 @@ builder.
<%= partial "partials/builder/alicloud/ecs/AlicloudDiskDevices-not-required" %>
<%= partial "partials/builder/alicloud/ecs/RunConfig-not-required" %>
<%= partial "partials/builder/alicloud/ecs/AlicloudImageConfig-not-required" %>
- `temporary_key_pair_name` (string) - The name of the temporary key pair to
generate. By default, Packer generates a name that looks like
`packer_<UUID>`, where &lt;UUID&gt; is a 36 character unique identifier.
## Basic Example

View File

@ -72,6 +72,10 @@ builders.
### AMI Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AMIConfig-required" %>
#### Optional:
<%= partial "partials/builder/amazon/common/AMIConfig-not-required" %>

View File

@ -52,6 +52,10 @@ necessary for this build to succeed and can be found further down the page.
### AMI Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AMIConfig-required" %>
#### Optional:
<%= partial "partials/builder/amazon/common/AMIConfig-not-required" %>
@ -93,6 +97,7 @@ Block devices can be nested in the
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %>
## Basic Example

View File

@ -46,6 +46,10 @@ necessary for this build to succeed and can be found further down the page.
### AMI Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AMIConfig-required" %>
#### Optional:
<%= partial "partials/builder/amazon/common/AMIConfig-not-required" %>
@ -92,6 +96,8 @@ Block devices can be nested in the
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %>
<%= partial "partials/helper/communicator/SSHInterface-not-required" %>
## Basic Example

View File

@ -55,6 +55,20 @@ necessary for this build to succeed and can be found further down the page.
<%= partial "partials/builder/amazon/common/AccessConfig-not-required" %>
### AMI Configuration
#### Optional:
- `snapshot_groups` (array of strings) - A list of groups that have access to
create volumes from the snapshot(s). By default no groups have permission
to create volumes from the snapshot(s). `all` will make the snapshot
publicly accessible.
- `snapshot_users` (array of strings) - A list of account IDs that have
access to create volumes from the snapshot(s). By default no additional
users other than the user creating the AMI has permissions to create
volumes from the backing snapshot(s).
### Block Devices Configuration
Block devices can be nested in the
@ -82,6 +96,8 @@ Block devices can be nested in the
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %>
<%= partial "partials/helper/communicator/SSHInterface-not-required" %>
## Basic Example

View File

@ -64,6 +64,10 @@ necessary for this build to succeed and can be found further down the page.
### AMI Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AMIConfig-required" %>
#### Optional:
<%= partial "partials/builder/amazon/common/AMIConfig-not-required" %>
@ -105,6 +109,8 @@ Block devices can be nested in the
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %>
<%= partial "partials/helper/communicator/SSHInterface-not-required" %>
## Basic Example

View File

@ -62,6 +62,13 @@ builder.
<%= partial "partials/builder/openstack/ImageConfig-not-required" %>
<%= partial "partials/builder/openstack/RunConfig-not-required" %>
### Communicator Configuration
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %>
## Basic Example: DevStack

View File

@ -76,13 +76,11 @@ necessary for this build to succeed and can be found further down the page.
### Required:
<%= partial "partials/builder/virtualbox/ovf/Config-required" %>
<%= partial "partials/builder/vmware/vmx/Config-required" %>
#### Optional:
<%= partial "partials/builder/virtualbox/ovf/Config-not-required" %>
<%= partial "partials/builder/virtualbox/common/VBoxVersionConfig-not-required" %>
<%= partial "partials/builder/virtualbox/common/GuestAdditionsConfig-not-required" %>
<%= partial "partials/builder/vmware/vmx/Config-not-required" %>
### Http directory configuration
@ -103,19 +101,19 @@ necessary for this build to succeed and can be found further down the page.
#### Optional:
<%= partial "partials/builder/virtualbox/common/ExportConfig-not-required" %>
<%= partial "partials/builder/vmware/common/ExportConfig-not-required" %>
### Output configuration
#### Optional:
<%= partial "partials/builder/virtualbox/common/OutputConfig-not-required" %>
<%= partial "partials/builder/vmware/common/OutputConfig-not-required" %>
### Run configuration
#### Optional:
<%= partial "partials/builder/virtualbox/common/RunConfig-not-required" %>
<%= partial "partials/builder/vmware/common/RunConfig-not-required" %>
### Driver configuration
@ -135,12 +133,6 @@ necessary for this build to succeed and can be found further down the page.
<%= partial "partials/builder/vmware/common/VMXConfig-not-required" %>
### Shutdown configuration
#### Optional:
<%= partial "partials/builder/virtualbox/common/ShutdownConfig-not-required" %>
### Communicator configuration
#### Optional common fields:
@ -150,29 +142,34 @@ necessary for this build to succeed and can be found further down the page.
#### Optional SSH fields:
<%= partial "partials/helper/communicator/SSH-not-required" %>
<%= partial "partials/builder/virtualbox/common/SSHConfig-not-required" %>
<%= partial "partials/builder/vmware/common/SSHConfig-not-required" %>
#### Optional WinRM fields:
<%= partial "partials/helper/communicator/WinRM-not-required" %>
## Boot Command
## Shutdown Configuration
The `boot_command` configuration is very important: it specifies the keys to
type when the virtual machine is first booted in order to start the OS
installer. This command is typed after `boot_wait`.
<%= partial "partials/common/shutdowncommand/ShutdownConfig-not-required" %>
As documented above, the `boot_command` is an array of strings. The strings are
all typed in sequence. It is an array only to improve readability within the
template.
## Boot Configuration
The boot command is "typed" character for character over a VNC connection to the
machine, simulating a human actually typing the keyboard.
<%= partial "partials/common/bootcommand/BootConfig" %>
<%= partial "partials/common/bootcommand/VNCConfig" %>
-&gt; Keystrokes are typed as separate key up/down events over VNC with a
default 100ms delay. The delay alleviates issues with latency and CPU
contention. You can tune this delay on a per-builder basis by specifying
"boot_key_interval" in your Packer template, for example:
-&gt; **Note**: for the `HTTPIP` to be resolved correctly, your VM's network
configuration has to include a `hostonly` or `nat` type network interface.
If you are using this feature, it is recommended to leave the default network
configuration while you are building the VM, and use the `vmx_data_post` hook
to modify the network configuration after the VM is done building.
#### Optional:
<%= partial "partials/common/bootcommand/VNCConfig-not-required" %>
<%= partial "partials/common/bootcommand/BootConfig-not-required" %>
For more examples of various boot commands, see the sample projects from our
[community templates page](/community-tools.html#templates).
```
{
@ -186,48 +183,6 @@ contention. You can tune this delay on a per-builder basis by specifying
}
```
- `<f1>` - `<f12>` - Simulates pressing a function key.
- `<up>` `<down>` `<left>` `<right>` - Simulates pressing an arrow key.
- `<spacebar>` - Simulates pressing the spacebar.
- `<insert>` - Simulates pressing the insert key.
- `<home>` `<end>` - Simulates pressing the home and end keys.
- `<pageUp>` `<pageDown>` - Simulates pressing the page up and page down keys.
- `<leftAlt>` `<rightAlt>` - Simulates pressing the alt key.
- `<leftCtrl>` `<rightCtrl>` - Simulates pressing the ctrl key.
- `<leftShift>` `<rightShift>` - Simulates pressing the shift key.
- `<leftAltOn>` `<rightAltOn>` - Simulates pressing and holding the alt key.
- `<leftCtrlOn>` `<rightCtrlOn>` - Simulates pressing and holding the ctrl
key.
- `<leftShiftOn>` `<rightShiftOn>` - Simulates pressing and holding the
shift key.
- `<leftAltOff>` `<rightAltOff>` - Simulates releasing a held alt key.
- `<leftCtrlOff>` `<rightCtrlOff>` - Simulates releasing a held ctrl key.
- `<leftShiftOff>` `<rightShiftOff>` - Simulates releasing a held shift key.
- `<wait>` `<wait5>` `<wait10>` - Adds a 1, 5 or 10 second pause before
sending any additional keys. This is useful if you have to generally wait
for the UI to update before typing more.
In addition to the special keys, each command to type is treated as a
[configuration template](/docs/templates/configuration-templates.html). The
available variables are:
<%= partial "partials/builders/boot-command" %>
Example boot command. This is actually a working boot command used to start an
Ubuntu 12.04 installer:

View File

@ -1,11 +1,13 @@
<!-- Code generated from the comments of the Config struct in builder/amazon/chroot/builder.go; DO NOT EDIT MANUALLY -->
- `ami_block_device_mappings` (BlockDevices) - Add one or more block device mappings to the AMI. If this field is
populated, and you are building from an existing source image, the block
device mappings in the source image will be overwritten. This means you
must have a block device mapping entry for your root volume,
`root_volume_size` and `root_device_name`. See the
[BlockDevices](#block-devices-configuration) documentation for fields.
- `ami_block_device_mappings` (BlockDevices) - Add one or more [block device
mappings](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
to the AMI. If this field is populated, and you are building from an
existing source image, the block device mappings in the source image
will be overwritten. This means you must have a block device mapping
entry for your root volume, `root_volume_size` and `root_device_name`.
See the [BlockDevices](#block-devices-configuration) documentation for
fields.
- `chroot_mounts` ([][]string) - This is a list of devices to mount into the chroot environment. This
configuration parameter requires some additional documentation which is

View File

@ -12,8 +12,10 @@
- `insecure_skip_tls_verify` (bool) - This allows skipping TLS
verification of the AWS EC2 endpoint. The default is false.
- `mfa_code` (string) - The MFA TOTP code. This should probably be a user variable since it
changes all the time.
- `mfa_code` (string) - The MFA
[TOTP](https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm)
code. This should probably be a user variable since it changes all the
time.
- `profile` (string) - The profile to use in the shared credentials file for
AWS. See Amazon's documentation on [specifying

View File

@ -14,7 +14,9 @@
encrypted one.
- `iops` (int64) - The number of I/O operations per second (IOPS) that the volume supports.
See the documentation on IOPs for more information
See the documentation on
[IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
for more information
- `no_device` (bool) - Suppresses the specified device included in the block device mapping of
the AMI.

View File

@ -231,10 +231,33 @@
- `user_data_file` (string) - Path to a file that will be used for the user
data when launching the instance.
- `vpc_filter` (VpcFilterOptions) - Filters used to populate the vpc_id field.
vpc_id take precedence over this.
- `vpc_filter` (VpcFilterOptions) - Filters used to populate the `vpc_id` field.
Example:
``` json
{
"vpc_filter": {
"filters": {
"tag:Class": "build",
"isDefault": "false",
"cidr": "/24"
}
}
}
```
This selects the VPC with tag `Class` with the value `build`, which is not
the default VPC, and have a IPv4 CIDR block of `/24`. NOTE: This will fail
unless *exactly* one VPC is returned.
- `filters` (map of strings) - filters used to select a `vpc_id`. NOTE:
This will fail unless *exactly* one VPC is returned. Any filter
described in the docs for
[DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html)
is valid.
`vpc_id` take precedence over this.
- `vpc_id` (string) - If launching into a VPC subnet, Packer needs the VPC ID
in order to create a temporary security group within the VPC. Requires
subnet_id to be set. If this field is left blank, Packer will try to get

View File

@ -7,8 +7,8 @@
/app", "EXPOSE 8080" ]
- `container_dir` (string) - The directory inside container to mount temp directory from host server
for work file provisioner. This defaults to c:/packer-files on windows
and /packer-files on other systems.
for work [file provisioner](/docs/provisioners/file.html). This defaults
to c:/packer-files on windows and /packer-files on other systems.
- `exec_user` (string) - Username (UID) to run remote commands with. You can also set the group
name/ID if you want: (UID or UID:GID). You may need this if you get

View File

@ -1,8 +1,18 @@
<!-- Code generated from the comments of the Config struct in builder/vmware/vmx/config.go; DO NOT EDIT MANUALLY -->
- `linked` (bool) - By default Packer creates a 'full' clone of
the virtual machine specified in source_path. The resultant virtual
machine is fully independant from the parent it was cloned from.
- `linked` (bool) - By default Packer creates a 'full' clone of the virtual machine
specified in source_path. The resultant virtual machine is fully
independant from the parent it was cloned from.
Setting linked to true instead causes Packer to create the virtual
machine as a 'linked' clone. Linked clones use and require ongoing
access to the disks of the parent virtual machine. The benefit of a
linked clone is that the clones virtual disk is typically very much
smaller than would be the case for a full clone. Additionally, the
cloned virtual machine can also be created much faster. Creating a
linked clone will typically only be of benefit in some advanced build
scenarios. Most users will wish to create a full clone instead. Defaults
to false.
- `remote_type` (string) - The type of remote machine that will be used to
build this VM rather than a local desktop product. The only value accepted

View File

@ -18,7 +18,10 @@
or `ssh_agent_auth` must be specified when `ssh_keypair_name` is
utilized.
- `temporary_key_pair_name` (string) - SSH Temporary Key Pair Name
- `temporary_key_pair_name` (string) - The name of the temporary key pair to generate. By default, Packer
generates a name that looks like `packer_<UUID>`, where &lt;UUID&gt; is
a 36 character unique identifier.
- `ssh_clear_authorized_keys` (bool) - If true, Packer will attempt to remove its temporary key from
`~/.ssh/authorized_keys` and `/root/.ssh/authorized_keys`. This is a
mostly cosmetic option, since Packer will delete the temporary private