make fmt autogenerated docs

This commit is contained in:
Adrien Delorme 2019-06-06 16:29:25 +02:00
parent 8488176dae
commit 4399684372
68 changed files with 1858 additions and 1850 deletions

View File

@ -15,23 +15,23 @@ import (
// Config of alicloud
type AlicloudAccessConfig struct {
// This is the Alicloud access key. It must be
// provided, but it can also be sourced from the ALICLOUD_ACCESS_KEY
// environment variable.
AlicloudAccessKey string `mapstructure:"access_key" required:"true"`
// provided, but it can also be sourced from the ALICLOUD_ACCESS_KEY
// environment variable.
AlicloudAccessKey string `mapstructure:"access_key" required:"true"`
// This is the Alicloud secret key. It must be
// provided, but it can also be sourced from the ALICLOUD_SECRET_KEY
// environment variable.
AlicloudSecretKey string `mapstructure:"secret_key" required:"true"`
// provided, but it can also be sourced from the ALICLOUD_SECRET_KEY
// environment variable.
AlicloudSecretKey string `mapstructure:"secret_key" required:"true"`
// This is the Alicloud region. It must be provided, but
// it can also be sourced from the ALICLOUD_REGION environment variables.
AlicloudRegion string `mapstructure:"region" required:"true"`
// it can also be sourced from the ALICLOUD_REGION environment variables.
AlicloudRegion string `mapstructure:"region" required:"true"`
// The region validation can be skipped
// if this value is true, the default value is false.
AlicloudSkipValidation bool `mapstructure:"skip_region_validation" required:"false"`
// if this value is true, the default value is false.
AlicloudSkipValidation bool `mapstructure:"skip_region_validation" required:"false"`
// STS access token, can be set through template
// or by exporting as environment variable such as
// export SecurityToken=value.
SecurityToken string `mapstructure:"security_token" required:"false"`
// or by exporting as environment variable such as
// export SecurityToken=value.
SecurityToken string `mapstructure:"security_token" required:"false"`
client *ClientWrapper
}

View File

@ -12,111 +12,111 @@ import (
type AlicloudDiskDevice struct {
// The value of disk name is blank by default. [2,
// 128] English or Chinese characters, must begin with an
// uppercase/lowercase letter or Chinese character. Can contain numbers,
// ., _ and -. The disk name will appear on the console. It cannot
// begin with http:// or https://.
DiskName string `mapstructure:"disk_name" required:"false"`
// 128] English or Chinese characters, must begin with an
// uppercase/lowercase letter or Chinese character. Can contain numbers,
// ., _ and -. The disk name will appear on the console. It cannot
// begin with http:// or https://.
DiskName string `mapstructure:"disk_name" required:"false"`
// Category of the system disk. Optional values
// are:
// - cloud - general cloud disk
// - cloud_efficiency - efficiency cloud disk
// - cloud_ssd - cloud SSD
DiskCategory string `mapstructure:"disk_category" required:"false"`
// are:
// - cloud - general cloud disk
// - cloud_efficiency - efficiency cloud disk
// - cloud_ssd - cloud SSD
DiskCategory string `mapstructure:"disk_category" required:"false"`
// Size of the system disk, measured in GiB. Value
// range: [20, 500]. The specified value must be equal to or greater
// than max{20, ImageSize}. Default value: max{40, ImageSize}.
DiskSize int `mapstructure:"disk_size" required:"false"`
// range: [20, 500]. The specified value must be equal to or greater
// than max{20, ImageSize}. Default value: max{40, ImageSize}.
DiskSize int `mapstructure:"disk_size" required:"false"`
// Snapshots are used to create the data
// disk After this parameter is specified, Size is ignored. The actual
// size of the created disk is the size of the specified snapshot.
SnapshotId string `mapstructure:"disk_snapshot_id" required:"false"`
// disk After this parameter is specified, Size is ignored. The actual
// size of the created disk is the size of the specified snapshot.
SnapshotId string `mapstructure:"disk_snapshot_id" required:"false"`
// The value of disk description is blank by
// default. [2, 256] characters. The disk description will appear on the
// console. It cannot begin with http:// or https://.
Description string `mapstructure:"disk_description" required:"false"`
// default. [2, 256] characters. The disk description will appear on the
// console. It cannot begin with http:// or https://.
Description string `mapstructure:"disk_description" required:"false"`
// Whether or not the disk is
// released along with the instance:
DeleteWithInstance bool `mapstructure:"disk_delete_with_instance" required:"false"`
// released along with the instance:
DeleteWithInstance bool `mapstructure:"disk_delete_with_instance" required:"false"`
// Device information of the related instance:
// such as /dev/xvdb It is null unless the Status is In_use.
Device string `mapstructure:"disk_device" required:"false"`
// Whether or not to encrypt the data disk.
// If this option is set to true, the data disk will be encryped and corresponding snapshot in the target image will also be encrypted. By
// default, if this is an extra data disk, Packer will not encrypt the
// data disk. Otherwise, Packer will keep the encryption setting to what
// it was in the source image. Please refer to Introduction of ECS disk encryption
// for more details.
Encrypted *bool `mapstructure:"disk_encrypted" required:"false"`
// such as /dev/xvdb It is null unless the Status is In_use.
Device string `mapstructure:"disk_device" required:"false"`
// Whether or not to encrypt the data disk.
// If this option is set to true, the data disk will be encryped and corresponding snapshot in the target image will also be encrypted. By
// default, if this is an extra data disk, Packer will not encrypt the
// data disk. Otherwise, Packer will keep the encryption setting to what
// it was in the source image. Please refer to Introduction of ECS disk encryption
// for more details.
Encrypted *bool `mapstructure:"disk_encrypted" required:"false"`
}
type AlicloudDiskDevices struct {
// Image disk mapping for system
// disk.
ECSSystemDiskMapping AlicloudDiskDevice `mapstructure:"system_disk_mapping" required:"false"`
// disk.
ECSSystemDiskMapping AlicloudDiskDevice `mapstructure:"system_disk_mapping" required:"false"`
// Add one or more data
// disks to the image.
// disks to the image.
ECSImagesDiskMappings []AlicloudDiskDevice `mapstructure:"image_disk_mappings" required:"false"`
}
type AlicloudImageConfig struct {
// The name of the user-defined image, [2, 128]
// English or Chinese characters. It must begin with an uppercase/lowercase
// letter or a Chinese character, and may contain numbers, _ or -. It
// cannot begin with http:// or https://.
AlicloudImageName string `mapstructure:"image_name" required:"true"`
// English or Chinese characters. It must begin with an uppercase/lowercase
// letter or a Chinese character, and may contain numbers, _ or -. It
// cannot begin with http:// or https://.
AlicloudImageName string `mapstructure:"image_name" required:"true"`
// The version number of the image, with a length
// limit of 1 to 40 English characters.
AlicloudImageVersion string `mapstructure:"image_version" required:"false"`
// limit of 1 to 40 English characters.
AlicloudImageVersion string `mapstructure:"image_version" required:"false"`
// The description of the image, with a length
// limit of 0 to 256 characters. Leaving it blank means null, which is the
// default value. It cannot begin with http:// or https://.
AlicloudImageDescription string `mapstructure:"image_description" required:"false"`
// limit of 0 to 256 characters. Leaving it blank means null, which is the
// default value. It cannot begin with http:// or https://.
AlicloudImageDescription string `mapstructure:"image_description" required:"false"`
// The IDs of to-be-added Aliyun
// accounts to which the image is shared. The number of accounts is 1 to 10.
// If number of accounts is greater than 10, this parameter is ignored.
AlicloudImageShareAccounts []string `mapstructure:"image_share_account" required:"false"`
AlicloudImageUNShareAccounts []string `mapstructure:"image_unshare_account"`
// accounts to which the image is shared. The number of accounts is 1 to 10.
// If number of accounts is greater than 10, this parameter is ignored.
AlicloudImageShareAccounts []string `mapstructure:"image_share_account" required:"false"`
AlicloudImageUNShareAccounts []string `mapstructure:"image_unshare_account"`
// Copy to the destination regionIds.
AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions" required:"false"`
AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions" required:"false"`
// The name of the destination image,
// [2, 128] English or Chinese characters. It must begin with an
// uppercase/lowercase letter or a Chinese character, and may contain numbers,
// _ or -. It cannot begin with http:// or https://.
AlicloudImageDestinationNames []string `mapstructure:"image_copy_names" required:"false"`
// Whether or not to encrypt the target images, including those copied if image_copy_regions is specified. If this option
// is set to true, a temporary image will be created from the provisioned
// instance in the main region and an encrypted copy will be generated in the
// same region. By default, Packer will keep the encryption setting to what
// it was in the source image.
ImageEncrypted *bool `mapstructure:"image_encrypted" required:"false"`
// [2, 128] English or Chinese characters. It must begin with an
// uppercase/lowercase letter or a Chinese character, and may contain numbers,
// _ or -. It cannot begin with http:// or https://.
AlicloudImageDestinationNames []string `mapstructure:"image_copy_names" required:"false"`
// Whether or not to encrypt the target images, including those copied if image_copy_regions is specified. If this option
// is set to true, a temporary image will be created from the provisioned
// instance in the main region and an encrypted copy will be generated in the
// same region. By default, Packer will keep the encryption setting to what
// it was in the source image.
ImageEncrypted *bool `mapstructure:"image_encrypted" required:"false"`
// If this value is true, when the target
// image names including those copied are duplicated with existing images, it
// will delete the existing images and then create the target images,
// otherwise, the creation will fail. The default value is false. Check
// image_name and image_copy_names options for names of target images. If
// -force option is
// provided in build command, this option can be omitted and taken as true.
AlicloudImageForceDelete bool `mapstructure:"image_force_delete" required:"false"`
// image names including those copied are duplicated with existing images, it
// will delete the existing images and then create the target images,
// otherwise, the creation will fail. The default value is false. Check
// image_name and image_copy_names options for names of target images. If
// -force option is
// provided in build command, this option can be omitted and taken as true.
AlicloudImageForceDelete bool `mapstructure:"image_force_delete" required:"false"`
// If this value is true, when
// delete the duplicated existing images, the source snapshots of those images
// will be delete either. If
// -force option is
// provided in build command, this option can be omitted and taken as true.
AlicloudImageForceDeleteSnapshots bool `mapstructure:"image_force_delete_snapshots" required:"false"`
AlicloudImageForceDeleteInstances bool `mapstructure:"image_force_delete_instances"`
// delete the duplicated existing images, the source snapshots of those images
// will be delete either. If
// -force option is
// provided in build command, this option can be omitted and taken as true.
AlicloudImageForceDeleteSnapshots bool `mapstructure:"image_force_delete_snapshots" required:"false"`
AlicloudImageForceDeleteInstances bool `mapstructure:"image_force_delete_instances"`
// If this value is true, the image
// created will not include any snapshot of data disks. This option would be
// useful for any circumstance that default data disks with instance types are
// not concerned. The default value is false.
AlicloudImageIgnoreDataDisks bool `mapstructure:"image_ignore_data_disks" required:"false"`
// created will not include any snapshot of data disks. This option would be
// useful for any circumstance that default data disks with instance types are
// not concerned. The default value is false.
AlicloudImageIgnoreDataDisks bool `mapstructure:"image_ignore_data_disks" required:"false"`
// The region validation can be skipped
// if this value is true, the default value is false.
AlicloudImageSkipRegionValidation bool `mapstructure:"skip_region_validation" required:"false"`
// if this value is true, the default value is false.
AlicloudImageSkipRegionValidation bool `mapstructure:"skip_region_validation" required:"false"`
// Tags applied to the destination
// image and relevant snapshots.
AlicloudImageTags map[string]string `mapstructure:"tags" required:"false"`
AlicloudDiskDevices `mapstructure:",squash"`
// image and relevant snapshots.
AlicloudImageTags map[string]string `mapstructure:"tags" required:"false"`
AlicloudDiskDevices `mapstructure:",squash"`
}
func (c *AlicloudImageConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -14,96 +14,96 @@ import (
)
type RunConfig struct {
AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address"`
AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address"`
// ID of the zone to which the disk belongs.
ZoneId string `mapstructure:"zone_id" required:"false"`
ZoneId string `mapstructure:"zone_id" required:"false"`
// Whether an ECS instance is I/O optimized or not.
// The default value is false.
IOOptimized bool `mapstructure:"io_optimized" required:"false"`
// The default value is false.
IOOptimized bool `mapstructure:"io_optimized" required:"false"`
// Type of the instance. For values, see Instance
// Type
// Table.
// You can also obtain the latest instance type table by invoking the
// Querying Instance Type
// Table
// interface.
InstanceType string `mapstructure:"instance_type" required:"true"`
Description string `mapstructure:"description"`
// Type
// Table.
// You can also obtain the latest instance type table by invoking the
// Querying Instance Type
// Table
// interface.
InstanceType string `mapstructure:"instance_type" required:"true"`
Description string `mapstructure:"description"`
// This is the base image id which you want to
// create your customized images.
AlicloudSourceImage string `mapstructure:"source_image" required:"true"`
// create your customized images.
AlicloudSourceImage string `mapstructure:"source_image" required:"true"`
// Whether to force shutdown upon device
// restart. The default value is false.
ForceStopInstance bool `mapstructure:"force_stop_instance" required:"false"`
// restart. The default value is false.
ForceStopInstance bool `mapstructure:"force_stop_instance" required:"false"`
// If this option is set to true, Packer
// will not stop the instance for you, and you need to make sure the instance
// will be stopped in the final provisioner command. Otherwise, Packer will
// timeout while waiting the instance to be stopped. This option is provided
// for some specific scenarios that you want to stop the instance by yourself.
// E.g., Sysprep a windows which may shutdown the instance within its command.
// The default value is false.
DisableStopInstance bool `mapstructure:"disable_stop_instance" required:"false"`
// will not stop the instance for you, and you need to make sure the instance
// will be stopped in the final provisioner command. Otherwise, Packer will
// timeout while waiting the instance to be stopped. This option is provided
// for some specific scenarios that you want to stop the instance by yourself.
// E.g., Sysprep a windows which may shutdown the instance within its command.
// The default value is false.
DisableStopInstance bool `mapstructure:"disable_stop_instance" required:"false"`
// ID of the security group to which a newly
// created instance belongs. Mutual access is allowed between instances in one
// security group. If not specified, the newly created instance will be added
// to the default security group. If the default group doesnt exist, or the
// number of instances in it has reached the maximum limit, a new security
// group will be created automatically.
SecurityGroupId string `mapstructure:"security_group_id" required:"false"`
// created instance belongs. Mutual access is allowed between instances in one
// security group. If not specified, the newly created instance will be added
// to the default security group. If the default group doesnt exist, or the
// number of instances in it has reached the maximum limit, a new security
// group will be created automatically.
SecurityGroupId string `mapstructure:"security_group_id" required:"false"`
// The security group name. The default value
// is blank. [2, 128] English or Chinese characters, must begin with an
// uppercase/lowercase letter or Chinese character. Can contain numbers, .,
// _ or -. It cannot begin with http:// or https://.
SecurityGroupName string `mapstructure:"security_group_name" required:"false"`
// is blank. [2, 128] English or Chinese characters, must begin with an
// uppercase/lowercase letter or Chinese character. Can contain numbers, .,
// _ or -. It cannot begin with http:// or https://.
SecurityGroupName string `mapstructure:"security_group_name" required:"false"`
// User data to apply when launching the instance. Note
// that you need to be careful about escaping characters due to the templates
// being JSON. It is often more convenient to use user_data_file, instead.
// Packer will not automatically wait for a user script to finish before
// shutting down the instance this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// that you need to be careful about escaping characters due to the templates
// being JSON. It is often more convenient to use user_data_file, instead.
// Packer will not automatically wait for a user script to finish before
// shutting down the instance this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// Path to a file that will be used for the user
// data when launching the instance.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// data when launching the instance.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// VPC ID allocated by the system.
VpcId string `mapstructure:"vpc_id" required:"false"`
VpcId string `mapstructure:"vpc_id" required:"false"`
// The VPC name. The default value is blank. [2, 128]
// English or Chinese characters, must begin with an uppercase/lowercase
// letter or Chinese character. Can contain numbers, _ and -. The disk
// description will appear on the console. Cannot begin with http:// or
// https://.
VpcName string `mapstructure:"vpc_name" required:"false"`
// English or Chinese characters, must begin with an uppercase/lowercase
// letter or Chinese character. Can contain numbers, _ and -. The disk
// description will appear on the console. Cannot begin with http:// or
// https://.
VpcName string `mapstructure:"vpc_name" required:"false"`
// Value options: 192.168.0.0/16 and
// 172.16.0.0/16. When not specified, the default value is 172.16.0.0/16.
CidrBlock string `mapstructure:"vpc_cidr_block" required:"false"`
// 172.16.0.0/16. When not specified, the default value is 172.16.0.0/16.
CidrBlock string `mapstructure:"vpc_cidr_block" required:"false"`
// The ID of the VSwitch to be used.
VSwitchId string `mapstructure:"vswitch_id" required:"false"`
VSwitchId string `mapstructure:"vswitch_id" required:"false"`
// The ID of the VSwitch to be used.
VSwitchName string `mapstructure:"vswitch_id" required:"false"`
VSwitchName string `mapstructure:"vswitch_id" required:"false"`
// Display name of the instance, which is a string
// of 2 to 128 Chinese or English characters. It must begin with an
// uppercase/lowercase letter or a Chinese character and can contain numerals,
// ., _, or -. The instance name is displayed on the Alibaba Cloud
// console. If this parameter is not specified, the default value is
// InstanceId of the instance. It cannot begin with http:// or https://.
InstanceName string `mapstructure:"instance_name" required:"false"`
// of 2 to 128 Chinese or English characters. It must begin with an
// uppercase/lowercase letter or a Chinese character and can contain numerals,
// ., _, or -. The instance name is displayed on the Alibaba Cloud
// console. If this parameter is not specified, the default value is
// InstanceId of the instance. It cannot begin with http:// or https://.
InstanceName string `mapstructure:"instance_name" required:"false"`
// Internet charge type, which can be
// PayByTraffic or PayByBandwidth. Optional values:
InternetChargeType string `mapstructure:"internet_charge_type" required:"false"`
// PayByTraffic or PayByBandwidth. Optional values:
InternetChargeType string `mapstructure:"internet_charge_type" required:"false"`
// Maximum outgoing bandwidth to the
// public network, measured in Mbps (Mega bits per second).
InternetMaxBandwidthOut int `mapstructure:"internet_max_bandwidth_out" required:"false"`
// public network, measured in Mbps (Mega bits per second).
InternetMaxBandwidthOut int `mapstructure:"internet_max_bandwidth_out" required:"false"`
// Timeout of creating snapshot(s).
// The default timeout is 3600 seconds if this option is not set or is set
// to 0. For those disks containing lots of data, it may require a higher
// timeout value.
WaitSnapshotReadyTimeout int `mapstructure:"wait_snapshot_ready_timeout" required:"false"`
// The default timeout is 3600 seconds if this option is not set or is set
// to 0. For those disks containing lots of data, it may require a higher
// timeout value.
WaitSnapshotReadyTimeout int `mapstructure:"wait_snapshot_ready_timeout" required:"false"`
// Communicator settings
Comm communicator.Config `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
// If this value is true, packer will connect to
// the ECS created through private ip instead of allocating a public ip or an
// EIP. The default value is false.
SSHPrivateIp bool `mapstructure:"ssh_private_ip" required:"false"`
// the ECS created through private ip instead of allocating a public ip or an
// EIP. The default value is false.
SSHPrivateIp bool `mapstructure:"ssh_private_ip" required:"false"`
}
func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -120,8 +120,8 @@ type RunConfig struct {
// Unlimited - even for instances that would usually qualify for the
// [AWS Free Tier](https://aws.amazon.com/free/).
EnableT2Unlimited bool `mapstructure:"enable_t2_unlimited" required:"false"`
// The name of an IAM instance
// profile
// The name of an [IAM instance
// profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html)
// to launch the EC2 instance with.
IamInstanceProfile string `mapstructure:"iam_instance_profile" required:"false"`
// Automatically terminate instances on
@ -131,8 +131,7 @@ type RunConfig struct {
// The EC2 instance type to use while building the
// AMI, such as t2.small.
InstanceType string `mapstructure:"instance_type" required:"true"`
// Filters used to populate the
// `security_group_ids` field. Example:
// Filters used to populate the `security_group_ids` field. Example:
//
// ``` json
// {
@ -143,6 +142,15 @@ type RunConfig struct {
// }
// }
// ```
//
// This selects the SG's with tag `Class` with the value `packer`.
//
// - `filters` (map of strings) - filters used to select a
// `security_group_ids`. Any filter described in the docs for
// [DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
// is valid.
// `security_group_ids` take precedence over this.
SecurityGroupFilter SecurityGroupFilterOptions `mapstructure:"security_group_filter" required:"false"`
// Tags to apply to the instance
// that is launched to create the AMI. These tags are not applied to the

View File

@ -28,13 +28,13 @@ type Config struct {
awscommon.BlockDevices `mapstructure:",squash"`
awscommon.AMIConfig `mapstructure:",squash"`
// A block device mapping
// describing the root device of the AMI. This looks like the mappings in
// ami_block_device_mapping, except with an additional field:
// describing the root device of the AMI. This looks like the mappings in
// ami_block_device_mapping, except with an additional field:
RootDevice RootBlockDevice `mapstructure:"ami_root_device" required:"true"`
VolumeRunTags awscommon.TagMap `mapstructure:"run_volume_tags"`
// what architecture to use when registering the
// final AMI; valid options are "x86_64" or "arm64". Defaults to "x86_64".
Architecture string `mapstructure:"ami_architecture" required:"false"`
// final AMI; valid options are "x86_64" or "arm64". Defaults to "x86_64".
Architecture string `mapstructure:"ami_architecture" required:"false"`
ctx interpolate.Context
}

View File

@ -9,30 +9,30 @@ import (
)
type RootBlockDevice struct {
SourceDeviceName string `mapstructure:"source_device_name"`
SourceDeviceName string `mapstructure:"source_device_name"`
// The device name exposed to the instance (for
// example, /dev/sdh or xvdh). Required for every device in the block
// device mapping.
DeviceName string `mapstructure:"device_name" required:"false"`
// example, /dev/sdh or xvdh). Required for every device in the block
// device mapping.
DeviceName string `mapstructure:"device_name" required:"false"`
// Indicates whether the EBS volume is
// deleted on instance termination. Default false. NOTE: If this
// value is not explicitly set to true and volumes are not cleaned up by
// an alternative method, additional volumes will accumulate after every
// build.
DeleteOnTermination bool `mapstructure:"delete_on_termination" required:"false"`
// deleted on instance termination. Default false. NOTE: If this
// value is not explicitly set to true and volumes are not cleaned up by
// an alternative method, additional volumes will accumulate after every
// build.
DeleteOnTermination bool `mapstructure:"delete_on_termination" required:"false"`
// The number of I/O operations per second (IOPS) that
// the volume supports. See the documentation on
// IOPs
// for more information
IOPS int64 `mapstructure:"iops" required:"false"`
// the volume supports. See the documentation on
// IOPs
// for more information
IOPS int64 `mapstructure:"iops" required:"false"`
// The volume type. gp2 for General Purpose
// (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, st1 for
// Throughput Optimized HDD, sc1 for Cold HDD, and standard for
// Magnetic volumes.
VolumeType string `mapstructure:"volume_type" required:"false"`
// (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, st1 for
// Throughput Optimized HDD, sc1 for Cold HDD, and standard for
// Magnetic volumes.
VolumeType string `mapstructure:"volume_type" required:"false"`
// The size of the volume, in GiB. Required if
// not specifying a snapshot_id.
VolumeSize int64 `mapstructure:"volume_size" required:"false"`
// not specifying a snapshot_id.
VolumeSize int64 `mapstructure:"volume_size" required:"false"`
}
func (c *RootBlockDevice) Prepare(ctx *interpolate.Context) []error {

View File

@ -10,9 +10,9 @@ import (
type BlockDevice struct {
awscommon.BlockDevice `mapstructure:"-,squash"`
// Tags applied to the AMI. This is a
// template engine, see Build template
// data for more information.
Tags awscommon.TagMap `mapstructure:"tags" required:"false"`
// template engine, see Build template
// data for more information.
Tags awscommon.TagMap `mapstructure:"tags" required:"false"`
}
func commonBlockDevices(mappings []BlockDevice, ctx *interpolate.Context) (awscommon.BlockDevices, error) {

View File

@ -33,43 +33,43 @@ type Config struct {
awscommon.BlockDevices `mapstructure:",squash"`
awscommon.RunConfig `mapstructure:",squash"`
// Your AWS account ID. This is required for bundling
// the AMI. This is not the same as the access key. You can find your
// account ID in the security credentials page of your AWS account.
AccountId string `mapstructure:"account_id" required:"true"`
// the AMI. This is not the same as the access key. You can find your
// account ID in the security credentials page of your AWS account.
AccountId string `mapstructure:"account_id" required:"true"`
// The directory on the running instance where
// the bundled AMI will be saved prior to uploading. By default this is
// /tmp. This directory must exist and be writable.
BundleDestination string `mapstructure:"bundle_destination" required:"false"`
// the bundled AMI will be saved prior to uploading. By default this is
// /tmp. This directory must exist and be writable.
BundleDestination string `mapstructure:"bundle_destination" required:"false"`
// The prefix for files created from bundling the
// root volume. By default this is image-{{timestamp}}. The timestamp
// variable should be used to make sure this is unique, otherwise it can
// collide with other created AMIs by Packer in your account.
BundlePrefix string `mapstructure:"bundle_prefix" required:"false"`
// root volume. By default this is image-{{timestamp}}. The timestamp
// variable should be used to make sure this is unique, otherwise it can
// collide with other created AMIs by Packer in your account.
BundlePrefix string `mapstructure:"bundle_prefix" required:"false"`
// The command to use to upload the bundled
// volume. See the "custom bundle commands" section below for more
// information.
// volume. See the "custom bundle commands" section below for more
// information.
BundleUploadCommand string `mapstructure:"bundle_upload_command" required:"false"`
// The command to use to bundle the volume.
// See the "custom bundle commands" section below for more information.
BundleVolCommand string `mapstructure:"bundle_vol_command" required:"false"`
// See the "custom bundle commands" section below for more information.
BundleVolCommand string `mapstructure:"bundle_vol_command" required:"false"`
// The name of the S3 bucket to upload the AMI. This
// bucket will be created if it doesn't exist.
S3Bucket string `mapstructure:"s3_bucket" required:"true"`
// bucket will be created if it doesn't exist.
S3Bucket string `mapstructure:"s3_bucket" required:"true"`
// The local path to a valid X509 certificate for
// your AWS account. This is used for bundling the AMI. This X509 certificate
// must be registered with your account from the security credentials page in
// the AWS console.
X509CertPath string `mapstructure:"x509_cert_path" required:"true"`
// your AWS account. This is used for bundling the AMI. This X509 certificate
// must be registered with your account from the security credentials page in
// the AWS console.
X509CertPath string `mapstructure:"x509_cert_path" required:"true"`
// The local path to the private key for the X509
// certificate specified by x509_cert_path. This is used for bundling the
// AMI.
X509KeyPath string `mapstructure:"x509_key_path" required:"true"`
// certificate specified by x509_cert_path. This is used for bundling the
// AMI.
X509KeyPath string `mapstructure:"x509_key_path" required:"true"`
// The path on the remote machine where the X509
// certificate will be uploaded. This path must already exist and be writable.
// X509 certificates are uploaded after provisioning is run, so it is
// perfectly okay to create this directory as part of the provisioning
// process. Defaults to /tmp.
X509UploadPath string `mapstructure:"x509_upload_path" required:"false"`
// certificate will be uploaded. This path must already exist and be writable.
// X509 certificates are uploaded after provisioning is run, so it is
// perfectly okay to create this directory as part of the provisioning
// process. Defaults to /tmp.
X509UploadPath string `mapstructure:"x509_upload_path" required:"false"`
ctx interpolate.Context
}

View File

@ -17,8 +17,8 @@ import (
// ClientConfig allows for various ways to authenticate Azure clients
type ClientConfig struct {
// One of Public, China, Germany, or
// USGovernment. Defaults to Public. Long forms such as
// USGovernmentCloud and AzureUSGovernmentCloud are also supported.
// USGovernment. Defaults to Public. Long forms such as
// USGovernmentCloud and AzureUSGovernmentCloud are also supported.
CloudEnvironmentName string `mapstructure:"cloud_environment_name" required:"false"`
cloudEnvironment *azure.Environment
@ -31,11 +31,11 @@ type ClientConfig struct {
// Certificate path for client auth
ClientCertPath string `mapstructure:"client_cert_path"`
// JWT bearer token for client auth (RFC 7523, Sec. 2.2)
ClientJWT string `mapstructure:"client_jwt"`
ObjectID string `mapstructure:"object_id"`
ClientJWT string `mapstructure:"client_jwt"`
ObjectID string `mapstructure:"object_id"`
// The account identifier with which your client_id and
// subscription_id are associated. If not specified, tenant_id will be
// looked up using subscription_id.
// subscription_id are associated. If not specified, tenant_id will be
// looked up using subscription_id.
TenantID string `mapstructure:"tenant_id" required:"false"`
SubscriptionID string `mapstructure:"subscription_id"`
}

View File

@ -73,11 +73,11 @@ type SharedImageGallery struct {
GalleryName string `mapstructure:"gallery_name"`
ImageName string `mapstructure:"image_name"`
// Specify a specific version of an OS to boot from.
// Defaults to latest. There may be a difference in versions available
// across regions due to image synchronization latency. To ensure a consistent
// version across regions set this value to one that is available in all
// regions where you are deploying.
ImageVersion string `mapstructure:"image_version" required:"false"`
// Defaults to latest. There may be a difference in versions available
// across regions due to image synchronization latency. To ensure a consistent
// version across regions set this value to one that is available in all
// regions where you are deploying.
ImageVersion string `mapstructure:"image_version" required:"false"`
}
type Config struct {
@ -90,147 +90,147 @@ type Config struct {
CaptureNamePrefix string `mapstructure:"capture_name_prefix"`
CaptureContainerName string `mapstructure:"capture_container_name"`
// Use a Shared Gallery
// image
// as the source for this build. VHD targets are incompatible with this build
// type - the target must be a Managed Image.
// image
// as the source for this build. VHD targets are incompatible with this build
// type - the target must be a Managed Image.
SharedGallery SharedImageGallery `mapstructure:"shared_image_gallery" required:"false"`
// PublisherName for your base image. See
// documentation
// for details.
// documentation
// for details.
ImagePublisher string `mapstructure:"image_publisher" required:"true"`
// Offer for your base image. See
// documentation
// for details.
ImageOffer string `mapstructure:"image_offer" required:"true"`
// documentation
// for details.
ImageOffer string `mapstructure:"image_offer" required:"true"`
// SKU for your base image. See
// documentation
// for details.
ImageSku string `mapstructure:"image_sku" required:"true"`
// documentation
// for details.
ImageSku string `mapstructure:"image_sku" required:"true"`
// Specify a specific version of an OS to boot from.
// Defaults to latest. There may be a difference in versions available
// across regions due to image synchronization latency. To ensure a consistent
// version across regions set this value to one that is available in all
// regions where you are deploying.
ImageVersion string `mapstructure:"image_version" required:"false"`
// Defaults to latest. There may be a difference in versions available
// across regions due to image synchronization latency. To ensure a consistent
// version across regions set this value to one that is available in all
// regions where you are deploying.
ImageVersion string `mapstructure:"image_version" required:"false"`
// Specify a custom VHD to use. If this value is set, do
// not set image_publisher, image_offer, image_sku, or image_version.
ImageUrl string `mapstructure:"image_url" required:"false"`
// not set image_publisher, image_offer, image_sku, or image_version.
ImageUrl string `mapstructure:"image_url" required:"false"`
// Specify the source
// managed image's resource group used to use. If this value is set, do not
// set image_publisher, image_offer, image_sku, or image_version. If this
// value is set, the value custom_managed_image_name must also be set. See
// documentation
// to learn more about managed images.
// managed image's resource group used to use. If this value is set, do not
// set image_publisher, image_offer, image_sku, or image_version. If this
// value is set, the value custom_managed_image_name must also be set. See
// documentation
// to learn more about managed images.
CustomManagedImageResourceGroupName string `mapstructure:"custom_managed_image_resource_group_name" required:"false"`
// Specify the source managed image's
// name to use. If this value is set, do not set image_publisher,
// image_offer, image_sku, or image_version. If this value is set, the
// value custom_managed_image_resource_group_name must also be set. See
// documentation
// to learn more about managed images.
CustomManagedImageName string `mapstructure:"custom_managed_image_name" required:"false"`
customManagedImageID string
// name to use. If this value is set, do not set image_publisher,
// image_offer, image_sku, or image_version. If this value is set, the
// value custom_managed_image_resource_group_name must also be set. See
// documentation
// to learn more about managed images.
CustomManagedImageName string `mapstructure:"custom_managed_image_name" required:"false"`
customManagedImageID string
Location string `mapstructure:"location"`
// Size of the VM used for building. This can be changed
// when you deploy a VM from your VHD. See
// pricing
// information. Defaults to Standard_A1.
VMSize string `mapstructure:"vm_size" required:"false"`
// when you deploy a VM from your VHD. See
// pricing
// information. Defaults to Standard_A1.
VMSize string `mapstructure:"vm_size" required:"false"`
ManagedImageResourceGroupName string `mapstructure:"managed_image_resource_group_name"`
ManagedImageName string `mapstructure:"managed_image_name"`
ManagedImageResourceGroupName string `mapstructure:"managed_image_resource_group_name"`
ManagedImageName string `mapstructure:"managed_image_name"`
// Specify the storage account
// type for a managed image. Valid values are Standard_LRS and Premium_LRS.
// The default is Standard_LRS.
ManagedImageStorageAccountType string `mapstructure:"managed_image_storage_account_type" required:"false"`
managedImageStorageAccountType compute.StorageAccountTypes
// type for a managed image. Valid values are Standard_LRS and Premium_LRS.
// The default is Standard_LRS.
ManagedImageStorageAccountType string `mapstructure:"managed_image_storage_account_type" required:"false"`
managedImageStorageAccountType compute.StorageAccountTypes
// If
// managed_image_os_disk_snapshot_name is set, a snapshot of the OS disk
// is created with the same name as this value before the VM is captured.
ManagedImageOSDiskSnapshotName string `mapstructure:"managed_image_os_disk_snapshot_name" required:"false"`
// managed_image_os_disk_snapshot_name is set, a snapshot of the OS disk
// is created with the same name as this value before the VM is captured.
ManagedImageOSDiskSnapshotName string `mapstructure:"managed_image_os_disk_snapshot_name" required:"false"`
// If
// managed_image_data_disk_snapshot_prefix is set, snapshot of the data
// disk(s) is created with the same prefix as this value before the VM is
// captured.
// managed_image_data_disk_snapshot_prefix is set, snapshot of the data
// disk(s) is created with the same prefix as this value before the VM is
// captured.
ManagedImageDataDiskSnapshotPrefix string `mapstructure:"managed_image_data_disk_snapshot_prefix" required:"false"`
manageImageLocation string
// Store the image in zone-resilient storage. You need to create it
// in a region that supports availability zones.
ManagedImageZoneResilient bool `mapstructure:"managed_image_zone_resilient" required:"false"`
// in a region that supports availability zones.
ManagedImageZoneResilient bool `mapstructure:"managed_image_zone_resilient" required:"false"`
// the user can define up to 15
// tags. Tag names cannot exceed 512 characters, and tag values cannot exceed
// 256 characters. Tags are applied to every resource deployed by a Packer
// build, i.e. Resource Group, VM, NIC, VNET, Public IP, KeyVault, etc.
AzureTags map[string]*string `mapstructure:"azure_tags" required:"false"`
ResourceGroupName string `mapstructure:"resource_group_name"`
StorageAccount string `mapstructure:"storage_account"`
// tags. Tag names cannot exceed 512 characters, and tag values cannot exceed
// 256 characters. Tags are applied to every resource deployed by a Packer
// build, i.e. Resource Group, VM, NIC, VNET, Public IP, KeyVault, etc.
AzureTags map[string]*string `mapstructure:"azure_tags" required:"false"`
ResourceGroupName string `mapstructure:"resource_group_name"`
StorageAccount string `mapstructure:"storage_account"`
// temporary name assigned to the VM. If this
// value is not set, a random value will be assigned. Knowing the resource
// group and VM name allows one to execute commands to update the VM during a
// Packer build, e.g. attach a resource disk to the VM.
TempComputeName string `mapstructure:"temp_compute_name" required:"false"`
TempResourceGroupName string `mapstructure:"temp_resource_group_name"`
BuildResourceGroupName string `mapstructure:"build_resource_group_name"`
storageAccountBlobEndpoint string
// value is not set, a random value will be assigned. Knowing the resource
// group and VM name allows one to execute commands to update the VM during a
// Packer build, e.g. attach a resource disk to the VM.
TempComputeName string `mapstructure:"temp_compute_name" required:"false"`
TempResourceGroupName string `mapstructure:"temp_resource_group_name"`
BuildResourceGroupName string `mapstructure:"build_resource_group_name"`
storageAccountBlobEndpoint string
// This value allows you to
// set a virtual_network_name and obtain a public IP. If this value is not
// set and virtual_network_name is defined Packer is only allowed to be
// executed from a host on the same subnet / virtual network.
PrivateVirtualNetworkWithPublicIp bool `mapstructure:"private_virtual_network_with_public_ip" required:"false"`
// set a virtual_network_name and obtain a public IP. If this value is not
// set and virtual_network_name is defined Packer is only allowed to be
// executed from a host on the same subnet / virtual network.
PrivateVirtualNetworkWithPublicIp bool `mapstructure:"private_virtual_network_with_public_ip" required:"false"`
// Use a pre-existing virtual network for the
// VM. This option enables private communication with the VM, no public IP
// address is used or provisioned (unless you set
// private_virtual_network_with_public_ip).
VirtualNetworkName string `mapstructure:"virtual_network_name" required:"false"`
// VM. This option enables private communication with the VM, no public IP
// address is used or provisioned (unless you set
// private_virtual_network_with_public_ip).
VirtualNetworkName string `mapstructure:"virtual_network_name" required:"false"`
// If virtual_network_name is set,
// this value may also be set. If virtual_network_name is set, and this
// value is not set the builder attempts to determine the subnet to use with
// the virtual network. If the subnet cannot be found, or it cannot be
// disambiguated, this value should be set.
VirtualNetworkSubnetName string `mapstructure:"virtual_network_subnet_name" required:"false"`
// this value may also be set. If virtual_network_name is set, and this
// value is not set the builder attempts to determine the subnet to use with
// the virtual network. If the subnet cannot be found, or it cannot be
// disambiguated, this value should be set.
VirtualNetworkSubnetName string `mapstructure:"virtual_network_subnet_name" required:"false"`
// If virtual_network_name is
// set, this value may also be set. If virtual_network_name is set, and
// this value is not set the builder attempts to determine the resource group
// containing the virtual network. If the resource group cannot be found, or
// it cannot be disambiguated, this value should be set.
VirtualNetworkResourceGroupName string `mapstructure:"virtual_network_resource_group_name" required:"false"`
// set, this value may also be set. If virtual_network_name is set, and
// this value is not set the builder attempts to determine the resource group
// containing the virtual network. If the resource group cannot be found, or
// it cannot be disambiguated, this value should be set.
VirtualNetworkResourceGroupName string `mapstructure:"virtual_network_resource_group_name" required:"false"`
// Specify a file containing custom data to inject
// into the cloud-init process. The contents of the file are read and injected
// into the ARM template. The custom data will be passed to cloud-init for
// processing at the time of provisioning. See
// documentation
// to learn more about custom data, and how it can be used to influence the
// provisioning process.
CustomDataFile string `mapstructure:"custom_data_file" required:"false"`
customData string
// into the cloud-init process. The contents of the file are read and injected
// into the ARM template. The custom data will be passed to cloud-init for
// processing at the time of provisioning. See
// documentation
// to learn more about custom data, and how it can be used to influence the
// provisioning process.
CustomDataFile string `mapstructure:"custom_data_file" required:"false"`
customData string
// Used for creating images from Marketplace images.
// Please refer to Deploy an image with Marketplace
// terms for more details. Not
// all Marketplace images support programmatic deployment, and support is
// controlled by the image publisher.
PlanInfo PlanInformation `mapstructure:"plan_info" required:"false"`
// Please refer to Deploy an image with Marketplace
// terms for more details. Not
// all Marketplace images support programmatic deployment, and support is
// controlled by the image publisher.
PlanInfo PlanInformation `mapstructure:"plan_info" required:"false"`
// If either Linux or Windows is specified Packer will
// automatically configure authentication credentials for the provisioned
// machine. For Linux this configures an SSH authorized key. For Windows
// this configures a WinRM certificate.
OSType string `mapstructure:"os_type" required:"false"`
// automatically configure authentication credentials for the provisioned
// machine. For Linux this configures an SSH authorized key. For Windows
// this configures a WinRM certificate.
OSType string `mapstructure:"os_type" required:"false"`
// Specify the size of the OS disk in GB
// (gigabytes). Values of zero or less than zero are ignored.
OSDiskSizeGB int32 `mapstructure:"os_disk_size_gb" required:"false"`
// (gigabytes). Values of zero or less than zero are ignored.
OSDiskSizeGB int32 `mapstructure:"os_disk_size_gb" required:"false"`
// The size(s) of any additional
// hard disks for the VM in gigabytes. If this is not specified then the VM
// will only contain an OS disk. The number of additional disks and maximum
// size of a disk depends on the configuration of your VM. See
// Windows
// or
// Linux
// for more information.
// hard disks for the VM in gigabytes. If this is not specified then the VM
// will only contain an OS disk. The number of additional disks and maximum
// size of a disk depends on the configuration of your VM. See
// Windows
// or
// Linux
// for more information.
AdditionalDiskSize []int32 `mapstructure:"disk_additional_size" required:"false"`
// Specify the disk caching type. Valid values
// are None, ReadOnly, and ReadWrite. The default value is ReadWrite.
DiskCachingType string `mapstructure:"disk_caching_type" required:"false"`
diskCachingType compute.CachingTypes
// are None, ReadOnly, and ReadWrite. The default value is ReadWrite.
DiskCachingType string `mapstructure:"disk_caching_type" required:"false"`
diskCachingType compute.CachingTypes
// Runtime Values
UserName string
@ -257,9 +257,9 @@ type Config struct {
Comm communicator.Config `mapstructure:",squash"`
ctx interpolate.Context
// If you want packer to delete the
// temporary resource group asynchronously set this value. It's a boolean
// value and defaults to false. Important Setting this true means that
// your builds are faster, however any failed deletes are not reported.
// temporary resource group asynchronously set this value. It's a boolean
// value and defaults to false. Important Setting this true means that
// your builds are faster, however any failed deletes are not reported.
AsyncResourceGroupDelete bool `mapstructure:"async_resourcegroup_delete" required:"false"`
}

View File

@ -22,130 +22,130 @@ type Config struct {
common.HTTPConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
// The CloudStack API endpoint we will connect to. It can
// also be specified via environment variable CLOUDSTACK_API_URL, if set.
APIURL string `mapstructure:"api_url" required:"true"`
// also be specified via environment variable CLOUDSTACK_API_URL, if set.
APIURL string `mapstructure:"api_url" required:"true"`
// The API key used to sign all API requests. It can also
// be specified via environment variable CLOUDSTACK_API_KEY, if set.
APIKey string `mapstructure:"api_key" required:"true"`
// be specified via environment variable CLOUDSTACK_API_KEY, if set.
APIKey string `mapstructure:"api_key" required:"true"`
// The secret key used to sign all API requests. It
// can also be specified via environment variable CLOUDSTACK_SECRET_KEY, if
// set.
SecretKey string `mapstructure:"secret_key" required:"true"`
// can also be specified via environment variable CLOUDSTACK_SECRET_KEY, if
// set.
SecretKey string `mapstructure:"secret_key" required:"true"`
// The time duration to wait for async calls to
// finish. Defaults to 30m.
// finish. Defaults to 30m.
AsyncTimeout time.Duration `mapstructure:"async_timeout" required:"false"`
// Some cloud providers only allow HTTP GET calls
// to their CloudStack API. If using such a provider, you need to set this to
// true in order for the provider to only make GET calls and no POST calls.
HTTPGetOnly bool `mapstructure:"http_get_only" required:"false"`
// to their CloudStack API. If using such a provider, you need to set this to
// true in order for the provider to only make GET calls and no POST calls.
HTTPGetOnly bool `mapstructure:"http_get_only" required:"false"`
// Set to true to skip SSL verification.
// Defaults to false.
SSLNoVerify bool `mapstructure:"ssl_no_verify" required:"false"`
// Defaults to false.
SSLNoVerify bool `mapstructure:"ssl_no_verify" required:"false"`
// List of CIDR's that will have access to the new
// instance. This is needed in order for any provisioners to be able to
// connect to the instance. Defaults to [ "0.0.0.0/0" ]. Only required when
// use_local_ip_address is false.
CIDRList []string `mapstructure:"cidr_list" required:"false"`
// instance. This is needed in order for any provisioners to be able to
// connect to the instance. Defaults to [ "0.0.0.0/0" ]. Only required when
// use_local_ip_address is false.
CIDRList []string `mapstructure:"cidr_list" required:"false"`
// If true a temporary security group
// will be created which allows traffic towards the instance from the
// cidr_list. This option will be ignored if security_groups is also
// defined. Requires expunge set to true. Defaults to false.
CreateSecurityGroup bool `mapstructure:"create_security_group" required:"false"`
// will be created which allows traffic towards the instance from the
// cidr_list. This option will be ignored if security_groups is also
// defined. Requires expunge set to true. Defaults to false.
CreateSecurityGroup bool `mapstructure:"create_security_group" required:"false"`
// The name or ID of the disk offering used for the
// instance. This option is only available (and also required) when using
// source_iso.
DiskOffering string `mapstructure:"disk_offering" required:"false"`
// instance. This option is only available (and also required) when using
// source_iso.
DiskOffering string `mapstructure:"disk_offering" required:"false"`
// The size (in GB) of the root disk of the new
// instance. This option is only available when using source_template.
DiskSize int64 `mapstructure:"disk_size" required:"false"`
// instance. This option is only available when using source_template.
DiskSize int64 `mapstructure:"disk_size" required:"false"`
// Set to true to expunge the instance when it is
// destroyed. Defaults to false.
Expunge bool `mapstructure:"expunge" required:"false"`
// destroyed. Defaults to false.
Expunge bool `mapstructure:"expunge" required:"false"`
// The target hypervisor (e.g. XenServer, KVM) for
// the new template. This option is required when using source_iso.
Hypervisor string `mapstructure:"hypervisor" required:"false"`
// the new template. This option is required when using source_iso.
Hypervisor string `mapstructure:"hypervisor" required:"false"`
// The name of the instance. Defaults to
// "packer-UUID" where UUID is dynamically generated.
InstanceName string `mapstructure:"instance_name" required:"false"`
// "packer-UUID" where UUID is dynamically generated.
InstanceName string `mapstructure:"instance_name" required:"false"`
// The name or ID of the network to connect the instance
// to.
Network string `mapstructure:"network" required:"true"`
// to.
Network string `mapstructure:"network" required:"true"`
// The name or ID of the project to deploy the instance
// to.
Project string `mapstructure:"project" required:"false"`
// to.
Project string `mapstructure:"project" required:"false"`
// The public IP address or it's ID used for
// connecting any provisioners to. If not provided, a temporary public IP
// address will be associated and released during the Packer run.
PublicIPAddress string `mapstructure:"public_ip_address" required:"false"`
// connecting any provisioners to. If not provided, a temporary public IP
// address will be associated and released during the Packer run.
PublicIPAddress string `mapstructure:"public_ip_address" required:"false"`
// The fixed port you want to configure in the port
// forwarding rule. Set this attribute if you do not want to use the a random
// public port.
PublicPort int `mapstructure:"public_port" required:"false"`
// forwarding rule. Set this attribute if you do not want to use the a random
// public port.
PublicPort int `mapstructure:"public_port" required:"false"`
// A list of security group IDs or
// names to associate the instance with.
SecurityGroups []string `mapstructure:"security_groups" required:"false"`
// names to associate the instance with.
SecurityGroups []string `mapstructure:"security_groups" required:"false"`
// The name or ID of the service offering used
// for the instance.
ServiceOffering string `mapstructure:"service_offering" required:"true"`
// for the instance.
ServiceOffering string `mapstructure:"service_offering" required:"true"`
// Set to true to prevent network
// ACLs or firewall rules creation. Defaults to false.
PreventFirewallChanges bool `mapstructure:"prevent_firewall_changes" required:"false"`
// ACLs or firewall rules creation. Defaults to false.
PreventFirewallChanges bool `mapstructure:"prevent_firewall_changes" required:"false"`
// The name or ID of an ISO that will be mounted
// before booting the instance. This option is mutually exclusive with
// source_template. When using source_iso, both disk_offering and
// hypervisor are required.
SourceISO string `mapstructure:"source_iso" required:"true"`
// before booting the instance. This option is mutually exclusive with
// source_template. When using source_iso, both disk_offering and
// hypervisor are required.
SourceISO string `mapstructure:"source_iso" required:"true"`
// The name or ID of the template used as base
// template for the instance. This option is mutually exclusive with
// source_iso.
SourceTemplate string `mapstructure:"source_template" required:"true"`
// template for the instance. This option is mutually exclusive with
// source_iso.
SourceTemplate string `mapstructure:"source_template" required:"true"`
// The name of the temporary SSH key pair
// to generate. By default, Packer generates a name that looks like
// packer_<UUID>, where <UUID> is a 36 character unique identifier.
TemporaryKeypairName string `mapstructure:"temporary_keypair_name" required:"false"`
// to generate. By default, Packer generates a name that looks like
// packer_<UUID>, where <UUID> is a 36 character unique identifier.
TemporaryKeypairName string `mapstructure:"temporary_keypair_name" required:"false"`
// Set to true to indicate that the
// provisioners should connect to the local IP address of the instance.
UseLocalIPAddress bool `mapstructure:"use_local_ip_address" required:"false"`
// provisioners should connect to the local IP address of the instance.
UseLocalIPAddress bool `mapstructure:"use_local_ip_address" required:"false"`
// User data to launch with the instance. This is a
// template engine see User Data bellow for
// more details. Packer will not automatically wait for a user script to
// finish before shutting down the instance this must be handled in a
// provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// template engine see User Data bellow for
// more details. Packer will not automatically wait for a user script to
// finish before shutting down the instance this must be handled in a
// provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// Path to a file that will be used for the user
// data when launching the instance. This file will be parsed as a template
// engine see User Data bellow for more
// details.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// data when launching the instance. This file will be parsed as a template
// engine see User Data bellow for more
// details.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// The name or ID of the zone where the instance will be
// created.
Zone string `mapstructure:"zone" required:"true"`
// created.
Zone string `mapstructure:"zone" required:"true"`
// The name of the new template. Defaults to
// "packer-{{timestamp}}" where timestamp will be the current time.
TemplateName string `mapstructure:"template_name" required:"false"`
// "packer-{{timestamp}}" where timestamp will be the current time.
TemplateName string `mapstructure:"template_name" required:"false"`
// The display text of the new template.
// Defaults to the template_name.
TemplateDisplayText string `mapstructure:"template_display_text" required:"false"`
// Defaults to the template_name.
TemplateDisplayText string `mapstructure:"template_display_text" required:"false"`
// The name or ID of the template OS for the new
// template that will be created.
TemplateOS string `mapstructure:"template_os" required:"true"`
// template that will be created.
TemplateOS string `mapstructure:"template_os" required:"true"`
// Set to true to indicate that the template
// is featured. Defaults to false.
TemplateFeatured bool `mapstructure:"template_featured" required:"false"`
// is featured. Defaults to false.
TemplateFeatured bool `mapstructure:"template_featured" required:"false"`
// Set to true to indicate that the template
// is available for all accounts. Defaults to false.
TemplatePublic bool `mapstructure:"template_public" required:"false"`
// is available for all accounts. Defaults to false.
TemplatePublic bool `mapstructure:"template_public" required:"false"`
// Set to true to indicate the
// template should be password enabled. Defaults to false.
TemplatePasswordEnabled bool `mapstructure:"template_password_enabled" required:"false"`
// template should be password enabled. Defaults to false.
TemplatePasswordEnabled bool `mapstructure:"template_password_enabled" required:"false"`
// Set to true to indicate the template
// requires hardware-assisted virtualization. Defaults to false.
TemplateRequiresHVM bool `mapstructure:"template_requires_hvm" required:"false"`
// requires hardware-assisted virtualization. Defaults to false.
TemplateRequiresHVM bool `mapstructure:"template_requires_hvm" required:"false"`
// Set to true to indicate that the template
// contains tools to support dynamic scaling of VM cpu/memory. Defaults to
// false.
TemplateScalable bool `mapstructure:"template_scalable" required:"false"`
TemplateTag string `mapstructure:"template_tag"`
// contains tools to support dynamic scaling of VM cpu/memory. Defaults to
// false.
TemplateScalable bool `mapstructure:"template_scalable" required:"false"`
TemplateTag string `mapstructure:"template_tag"`
Tags map[string]string `mapstructure:"tags"`

View File

@ -22,60 +22,60 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
// The client TOKEN to use to access your account. It
// can also be specified via environment variable DIGITALOCEAN_API_TOKEN, if
// set.
// can also be specified via environment variable DIGITALOCEAN_API_TOKEN, if
// set.
APIToken string `mapstructure:"api_token" required:"true"`
// Non standard api endpoint URL. Set this if you are
// using a DigitalOcean API compatible service. It can also be specified via
// environment variable DIGITALOCEAN_API_URL.
APIURL string `mapstructure:"api_url" required:"false"`
// using a DigitalOcean API compatible service. It can also be specified via
// environment variable DIGITALOCEAN_API_URL.
APIURL string `mapstructure:"api_url" required:"false"`
// The name (or slug) of the region to launch the droplet
// in. Consequently, this is the region where the snapshot will be available.
// See
// https://developers.digitalocean.com/documentation/v2/#list-all-regions
// for the accepted region names/slugs.
// in. Consequently, this is the region where the snapshot will be available.
// See
// https://developers.digitalocean.com/documentation/v2/#list-all-regions
// for the accepted region names/slugs.
Region string `mapstructure:"region" required:"true"`
// The name (or slug) of the droplet size to use. See
// https://developers.digitalocean.com/documentation/v2/#list-all-sizes
// for the accepted size names/slugs.
Size string `mapstructure:"size" required:"true"`
// https://developers.digitalocean.com/documentation/v2/#list-all-sizes
// for the accepted size names/slugs.
Size string `mapstructure:"size" required:"true"`
// The name (or slug) of the base image to use. This is the
// image that will be used to launch a new droplet and provision it. See
// https://developers.digitalocean.com/documentation/v2/#list-all-images
// for details on how to get a list of the accepted image names/slugs.
Image string `mapstructure:"image" required:"true"`
// image that will be used to launch a new droplet and provision it. See
// https://developers.digitalocean.com/documentation/v2/#list-all-images
// for details on how to get a list of the accepted image names/slugs.
Image string `mapstructure:"image" required:"true"`
// Set to true to enable private networking
// for the droplet being created. This defaults to false, or not enabled.
PrivateNetworking bool `mapstructure:"private_networking" required:"false"`
// for the droplet being created. This defaults to false, or not enabled.
PrivateNetworking bool `mapstructure:"private_networking" required:"false"`
// Set to true to enable monitoring for the droplet
// being created. This defaults to false, or not enabled.
Monitoring bool `mapstructure:"monitoring" required:"false"`
// being created. This defaults to false, or not enabled.
Monitoring bool `mapstructure:"monitoring" required:"false"`
// Set to true to enable ipv6 for the droplet being
// created. This defaults to false, or not enabled.
IPv6 bool `mapstructure:"ipv6" required:"false"`
// created. This defaults to false, or not enabled.
IPv6 bool `mapstructure:"ipv6" required:"false"`
// The name of the resulting snapshot that will
// appear in your account. Defaults to "packer-{{timestamp}}" (see
// configuration templates for more info).
SnapshotName string `mapstructure:"snapshot_name" required:"false"`
// appear in your account. Defaults to "packer-{{timestamp}}" (see
// configuration templates for more info).
SnapshotName string `mapstructure:"snapshot_name" required:"false"`
// The regions of the resulting
// snapshot that will appear in your account.
SnapshotRegions []string `mapstructure:"snapshot_regions" required:"false"`
// snapshot that will appear in your account.
SnapshotRegions []string `mapstructure:"snapshot_regions" required:"false"`
// The time to wait, as a duration string, for a
// droplet to enter a desired state (such as "active") before timing out. The
// default state timeout is "6m".
StateTimeout time.Duration `mapstructure:"state_timeout" required:"false"`
// droplet to enter a desired state (such as "active") before timing out. The
// default state timeout is "6m".
StateTimeout time.Duration `mapstructure:"state_timeout" required:"false"`
// The name assigned to the droplet. DigitalOcean
// sets the hostname of the machine to this value.
DropletName string `mapstructure:"droplet_name" required:"false"`
// sets the hostname of the machine to this value.
DropletName string `mapstructure:"droplet_name" required:"false"`
// User data to launch with the Droplet. Packer will
// not automatically wait for a user script to finish before shutting down the
// instance this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// not automatically wait for a user script to finish before shutting down the
// instance this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// Path to a file that will be used for the user
// data when launching the Droplet.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// data when launching the Droplet.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// Tags to apply to the droplet when it is created
Tags []string `mapstructure:"tags" required:"false"`
Tags []string `mapstructure:"tags" required:"false"`
ctx interpolate.Context
}

View File

@ -26,69 +26,69 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
Author string
Changes []string
Commit bool
Author string
Changes []string
Commit bool
// 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.
ContainerDir string `mapstructure:"container_dir" required:"false"`
Discard bool
// directory from host server for work file
// provisioner. This defaults to
// c:/packer-files on windows and /packer-files on other systems.
ContainerDir string `mapstructure:"container_dir" required:"false"`
Discard bool
// 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 permission errors trying to run the shell or
// other provisioners.
ExecUser string `mapstructure:"exec_user" required:"false"`
ExportPath string `mapstructure:"export_path"`
Image string
Message string
// also set the group name/ID if you want: (UID or UID:GID).
// You may need this if you get permission errors trying to run the shell or
// other provisioners.
ExecUser string `mapstructure:"exec_user" required:"false"`
ExportPath string `mapstructure:"export_path"`
Image string
Message string
// If true, run the docker container with the
// --privileged flag. This defaults to false if not set.
Privileged bool `mapstructure:"privileged" required:"false"`
Pty bool
Pull bool
// --privileged flag. This defaults to false if not set.
Privileged bool `mapstructure:"privileged" required:"false"`
Pty bool
Pull bool
// An array of arguments to pass to
// docker run in order to run the container. By default this is set to
// ["-d", "-i", "-t", "--entrypoint=/bin/sh", "--", "{{.Image}}"] if you are
// using a linux container, and
// ["-d", "-i", "-t", "--entrypoint=powershell", "--", "{{.Image}}"] if you
// are running a windows container. {{.Image}} is a template variable that
// corresponds to the image template option. Passing the entrypoint option
// this way will make it the default entrypoint of the resulting image, so
// running docker run -it --rm will start the docker image from the
// /bin/sh shell interpreter; you could run a script or another shell by
// running docker run -it --rm -c /bin/bash. If your docker image
// embeds a binary intended to be run often, you should consider changing the
// default entrypoint to point to it.
RunCommand []string `mapstructure:"run_command" required:"false"`
Volumes map[string]string
// docker run in order to run the container. By default this is set to
// ["-d", "-i", "-t", "--entrypoint=/bin/sh", "--", "{{.Image}}"] if you are
// using a linux container, and
// ["-d", "-i", "-t", "--entrypoint=powershell", "--", "{{.Image}}"] if you
// are running a windows container. {{.Image}} is a template variable that
// corresponds to the image template option. Passing the entrypoint option
// this way will make it the default entrypoint of the resulting image, so
// running docker run -it --rm will start the docker image from the
// /bin/sh shell interpreter; you could run a script or another shell by
// running docker run -it --rm -c /bin/bash. If your docker image
// embeds a binary intended to be run often, you should consider changing the
// default entrypoint to point to it.
RunCommand []string `mapstructure:"run_command" required:"false"`
Volumes map[string]string
// If true, files uploaded to the container
// will be owned by the user the container is running as. If false, the owner
// will depend on the version of docker installed in the system. Defaults to
// true.
FixUploadOwner bool `mapstructure:"fix_upload_owner" required:"false"`
// will be owned by the user the container is running as. If false, the owner
// will depend on the version of docker installed in the system. Defaults to
// true.
FixUploadOwner bool `mapstructure:"fix_upload_owner" required:"false"`
// If "true", tells Packer that you are building a
// Windows container running on a windows host. This is necessary for building
// Windows containers, because our normal docker bindings do not work for them.
// Windows container running on a windows host. This is necessary for building
// Windows containers, because our normal docker bindings do not work for them.
WindowsContainer bool `mapstructure:"windows_container" required:"false"`
// This is used to login to dockerhub to pull a private base container. For
// pushing to dockerhub, see the docker post-processors
Login bool
Login bool
// The password to use to authenticate to login.
LoginPassword string `mapstructure:"login_password" required:"false"`
LoginPassword string `mapstructure:"login_password" required:"false"`
// The server address to login to.
LoginServer string `mapstructure:"login_server" required:"false"`
LoginServer string `mapstructure:"login_server" required:"false"`
// The username to use to authenticate to login.
LoginUsername string `mapstructure:"login_username" required:"false"`
LoginUsername string `mapstructure:"login_username" required:"false"`
// Defaults to false. If true, the builder will login
// in order to pull the image from Amazon EC2 Container Registry
// (ECR). The builder only logs in for the
// duration of the pull. If true login_server is required and login,
// login_username, and login_password will be ignored. For more
// information see the section on ECR.
EcrLogin bool `mapstructure:"ecr_login" required:"false"`
// in order to pull the image from Amazon EC2 Container Registry
// (ECR). The builder only logs in for the
// duration of the pull. If true login_server is required and login,
// login_username, and login_password will be ignored. For more
// information see the section on ECR.
EcrLogin bool `mapstructure:"ecr_login" required:"false"`
AwsAccessConfig `mapstructure:",squash"`
ctx interpolate.Context

View File

@ -16,23 +16,23 @@ import (
type AwsAccessConfig struct {
// The AWS access key used to communicate with
// AWS. Learn how to set
// this.
// AWS. Learn how to set
// this.
AccessKey string `mapstructure:"aws_access_key" required:"false"`
// The AWS secret key used to communicate with
// AWS. Learn how to set
// this.
// AWS. Learn how to set
// this.
SecretKey string `mapstructure:"aws_secret_key" required:"false"`
// The AWS access token to use. This is different from
// the access key and secret key. If you're not sure what this is, then you
// probably don't need it. This will also be read from the AWS_SESSION_TOKEN
// environmental variable.
Token string `mapstructure:"aws_token" required:"false"`
// the access key and secret key. If you're not sure what this is, then you
// probably don't need it. This will also be read from the AWS_SESSION_TOKEN
// environmental variable.
Token string `mapstructure:"aws_token" required:"false"`
// The AWS shared credentials profile used to
// communicate with AWS. Learn how to set
// this.
Profile string `mapstructure:"aws_profile" required:"false"`
cfg *common.AccessConfig
// communicate with AWS. Learn how to set
// this.
Profile string `mapstructure:"aws_profile" required:"false"`
cfg *common.AccessConfig
}
// Get a login token for Amazon AWS ECR. Returns username and password

View File

@ -27,137 +27,137 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
// The JSON file containing your account
// credentials. Not required if you run Packer on a GCE instance with a
// service account. Instructions for creating the file or using service
// accounts are above.
// credentials. Not required if you run Packer on a GCE instance with a
// service account. Instructions for creating the file or using service
// accounts are above.
AccountFile string `mapstructure:"account_file" required:"false"`
// The project ID that will be used to launch
// instances and store images.
ProjectId string `mapstructure:"project_id" required:"true"`
// instances and store images.
ProjectId string `mapstructure:"project_id" required:"true"`
// Full or partial URL of the guest accelerator
// type. GPU accelerators can only be used with
// "on_host_maintenance": "TERMINATE" option set. Example:
// "projects/project_id/zones/europe-west1-b/acceleratorTypes/nvidia-tesla-k80"
AcceleratorType string `mapstructure:"accelerator_type" required:"false"`
// type. GPU accelerators can only be used with
// "on_host_maintenance": "TERMINATE" option set. Example:
// "projects/project_id/zones/europe-west1-b/acceleratorTypes/nvidia-tesla-k80"
AcceleratorType string `mapstructure:"accelerator_type" required:"false"`
// Number of guest accelerator cards to add to
// the launched instance.
AcceleratorCount int64 `mapstructure:"accelerator_count" required:"false"`
// the launched instance.
AcceleratorCount int64 `mapstructure:"accelerator_count" required:"false"`
// The name of a pre-allocated static external IP
// address. Note, must be the name and not the actual IP address.
Address string `mapstructure:"address" required:"false"`
// address. Note, must be the name and not the actual IP address.
Address string `mapstructure:"address" required:"false"`
// If true, the default service
// account will not be used if service_account_email is not specified. Set
// this value to true and omit service_account_email to provision a VM with
// no service account.
DisableDefaultServiceAccount bool `mapstructure:"disable_default_service_account" required:"false"`
// account will not be used if service_account_email is not specified. Set
// this value to true and omit service_account_email to provision a VM with
// no service account.
DisableDefaultServiceAccount bool `mapstructure:"disable_default_service_account" required:"false"`
// The name of the disk, if unset the instance name
// will be used.
DiskName string `mapstructure:"disk_name" required:"false"`
// will be used.
DiskName string `mapstructure:"disk_name" required:"false"`
// The size of the disk in GB. This defaults to 10,
// which is 10GB.
DiskSizeGb int64 `mapstructure:"disk_size" required:"false"`
// which is 10GB.
DiskSizeGb int64 `mapstructure:"disk_size" required:"false"`
// Type of disk used to back your instance, like
// pd-ssd or pd-standard. Defaults to pd-standard.
DiskType string `mapstructure:"disk_type" required:"false"`
// pd-ssd or pd-standard. Defaults to pd-standard.
DiskType string `mapstructure:"disk_type" required:"false"`
// The unique name of the resulting image. Defaults to
// "packer-{{timestamp}}".
ImageName string `mapstructure:"image_name" required:"false"`
// "packer-{{timestamp}}".
ImageName string `mapstructure:"image_name" required:"false"`
// The description of the resulting image.
ImageDescription string `mapstructure:"image_description" required:"false"`
ImageDescription string `mapstructure:"image_description" required:"false"`
// Image encryption key to apply to the created image. Possible values:
ImageEncryptionKey *compute.CustomerEncryptionKey `mapstructure:"image_encryption_key" required:"false"`
ImageEncryptionKey *compute.CustomerEncryptionKey `mapstructure:"image_encryption_key" required:"false"`
// The name of the image family to which the
// resulting image belongs. You can create disks by specifying an image family
// instead of a specific image name. The image family always returns its
// latest image that is not deprecated.
ImageFamily string `mapstructure:"image_family" required:"false"`
// resulting image belongs. You can create disks by specifying an image family
// instead of a specific image name. The image family always returns its
// latest image that is not deprecated.
ImageFamily string `mapstructure:"image_family" required:"false"`
// Key/value pair labels to
// apply to the created image.
ImageLabels map[string]string `mapstructure:"image_labels" required:"false"`
// apply to the created image.
ImageLabels map[string]string `mapstructure:"image_labels" required:"false"`
// Licenses to apply to the created
// image.
ImageLicenses []string `mapstructure:"image_licenses" required:"false"`
// image.
ImageLicenses []string `mapstructure:"image_licenses" required:"false"`
// A name to give the launched instance. Beware
// that this must be unique. Defaults to "packer-{{uuid}}".
InstanceName string `mapstructure:"instance_name" required:"false"`
// that this must be unique. Defaults to "packer-{{uuid}}".
InstanceName string `mapstructure:"instance_name" required:"false"`
// Key/value pair labels to apply to
// the launched instance.
Labels map[string]string `mapstructure:"labels" required:"false"`
// the launched instance.
Labels map[string]string `mapstructure:"labels" required:"false"`
// The machine type. Defaults to "n1-standard-1".
MachineType string `mapstructure:"machine_type" required:"false"`
MachineType string `mapstructure:"machine_type" required:"false"`
// Metadata applied to the launched
// instance.
Metadata map[string]string `mapstructure:"metadata" required:"false"`
// instance.
Metadata map[string]string `mapstructure:"metadata" required:"false"`
// A Minimum CPU Platform for VM Instance.
// Availability and default CPU platforms vary across zones, based on the
// hardware available in each GCP zone.
// Details
MinCpuPlatform string `mapstructure:"min_cpu_platform" required:"false"`
// Availability and default CPU platforms vary across zones, based on the
// hardware available in each GCP zone.
// Details
MinCpuPlatform string `mapstructure:"min_cpu_platform" required:"false"`
// The Google Compute network id or URL to use for the
// launched instance. Defaults to "default". If the value is not a URL, it
// will be interpolated to
// projects/((network_project_id))/global/networks/((network)). This value
// is not required if a subnet is specified.
Network string `mapstructure:"network" required:"false"`
// launched instance. Defaults to "default". If the value is not a URL, it
// will be interpolated to
// projects/((network_project_id))/global/networks/((network)). This value
// is not required if a subnet is specified.
Network string `mapstructure:"network" required:"false"`
// The project ID for the network and
// subnetwork to use for launched instance. Defaults to project_id.
NetworkProjectId string `mapstructure:"network_project_id" required:"false"`
// subnetwork to use for launched instance. Defaults to project_id.
NetworkProjectId string `mapstructure:"network_project_id" required:"false"`
// If true, the instance will not have an
// external IP. use_internal_ip must be true if this property is true.
OmitExternalIP bool `mapstructure:"omit_external_ip" required:"false"`
// external IP. use_internal_ip must be true if this property is true.
OmitExternalIP bool `mapstructure:"omit_external_ip" required:"false"`
// Sets Host Maintenance Option. Valid
// choices are MIGRATE and TERMINATE. Please see GCE Instance Scheduling
// Options,
// as not all machine_types support MIGRATE (i.e. machines with GPUs). If
// preemptible is true this can only be TERMINATE. If preemptible is false,
// it defaults to MIGRATE
OnHostMaintenance string `mapstructure:"on_host_maintenance" required:"false"`
// choices are MIGRATE and TERMINATE. Please see GCE Instance Scheduling
// Options,
// as not all machine_types support MIGRATE (i.e. machines with GPUs). If
// preemptible is true this can only be TERMINATE. If preemptible is false,
// it defaults to MIGRATE
OnHostMaintenance string `mapstructure:"on_host_maintenance" required:"false"`
// If true, launch a preemptible instance.
Preemptible bool `mapstructure:"preemptible" required:"false"`
Preemptible bool `mapstructure:"preemptible" required:"false"`
// The time to wait for instance state changes.
// Defaults to "5m".
RawStateTimeout string `mapstructure:"state_timeout" required:"false"`
// Defaults to "5m".
RawStateTimeout string `mapstructure:"state_timeout" required:"false"`
// The region in which to launch the instance. Defaults to
// the region hosting the specified zone.
Region string `mapstructure:"region" required:"false"`
// the region hosting the specified zone.
Region string `mapstructure:"region" required:"false"`
// The service account scopes for launched
// instance. Defaults to:
Scopes []string `mapstructure:"scopes" required:"false"`
// instance. Defaults to:
Scopes []string `mapstructure:"scopes" required:"false"`
// The service account to be used for
// launched instance. Defaults to the project's default service account unless
// disable_default_service_account is true.
ServiceAccountEmail string `mapstructure:"service_account_email" required:"false"`
// launched instance. Defaults to the project's default service account unless
// disable_default_service_account is true.
ServiceAccountEmail string `mapstructure:"service_account_email" required:"false"`
// The source image to use to create the new image
// from. You can also specify source_image_family instead. If both
// source_image and source_image_family are specified, source_image
// takes precedence. Example: "debian-8-jessie-v20161027"
SourceImage string `mapstructure:"source_image" required:"true"`
// from. You can also specify source_image_family instead. If both
// source_image and source_image_family are specified, source_image
// takes precedence. Example: "debian-8-jessie-v20161027"
SourceImage string `mapstructure:"source_image" required:"true"`
// The source image family to use to create
// the new image from. The image family always returns its latest image that
// is not deprecated. Example: "debian-8".
SourceImageFamily string `mapstructure:"source_image_family" required:"true"`
// the new image from. The image family always returns its latest image that
// is not deprecated. Example: "debian-8".
SourceImageFamily string `mapstructure:"source_image_family" required:"true"`
// The project ID of the project
// containing the source image.
SourceImageProjectId string `mapstructure:"source_image_project_id" required:"false"`
// containing the source image.
SourceImageProjectId string `mapstructure:"source_image_project_id" required:"false"`
// The path to a startup script to run on the
// VM from which the image will be made.
StartupScriptFile string `mapstructure:"startup_script_file" required:"false"`
// VM from which the image will be made.
StartupScriptFile string `mapstructure:"startup_script_file" required:"false"`
// The Google Compute subnetwork id or URL to use for
// the launched instance. Only required if the network has been created with
// custom subnetting. Note, the region of the subnetwork must match the
// region or zone in which the VM is launched. If the value is not a URL,
// it will be interpolated to
// projects/((network_project_id))/regions/((region))/subnetworks/((subnetwork))
Subnetwork string `mapstructure:"subnetwork" required:"false"`
// the launched instance. Only required if the network has been created with
// custom subnetting. Note, the region of the subnetwork must match the
// region or zone in which the VM is launched. If the value is not a URL,
// it will be interpolated to
// projects/((network_project_id))/regions/((region))/subnetworks/((subnetwork))
Subnetwork string `mapstructure:"subnetwork" required:"false"`
// Assign network tags to apply firewall rules to
// VM instance.
Tags []string `mapstructure:"tags" required:"false"`
// VM instance.
Tags []string `mapstructure:"tags" required:"false"`
// If true, use the instance's internal IP
// instead of its external IP during building.
UseInternalIP bool `mapstructure:"use_internal_ip" required:"false"`
// instead of its external IP during building.
UseInternalIP bool `mapstructure:"use_internal_ip" required:"false"`
// The zone in which to launch the instance used to create
// the image. Example: "us-central1-a"
Zone string `mapstructure:"zone" required:"true"`
// the image. Example: "us-central1-a"
Zone string `mapstructure:"zone" required:"true"`
Account AccountFile
stateTimeout time.Duration

View File

@ -35,59 +35,59 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
// Custom API endpoint URL, compatible with HyperOne.
// It can also be specified via environment variable HYPERONE_API_URL.
APIURL string `mapstructure:"api_url" required:"false"`
// It can also be specified via environment variable HYPERONE_API_URL.
APIURL string `mapstructure:"api_url" required:"false"`
// The authentication token used to access your account.
// This can be either a session token or a service account token.
// If not defined, the builder will attempt to find it in the following order:
Token string `mapstructure:"token" required:"true"`
// This can be either a session token or a service account token.
// If not defined, the builder will attempt to find it in the following order:
Token string `mapstructure:"token" required:"true"`
// The id or name of the project. This field is required
// only if using session tokens. It should be skipped when using service
// account authentication.
Project string `mapstructure:"project" required:"true"`
// only if using session tokens. It should be skipped when using service
// account authentication.
Project string `mapstructure:"project" required:"true"`
// Login (an e-mail) on HyperOne platform. Set this
// if you want to fetch the token by SSH authentication.
// if you want to fetch the token by SSH authentication.
TokenLogin string `mapstructure:"token_login" required:"false"`
// Timeout for waiting on the API to complete
// a request. Defaults to 5m.
// a request. Defaults to 5m.
StateTimeout time.Duration `mapstructure:"state_timeout" required:"false"`
// ID or name of the image to launch server from.
SourceImage string `mapstructure:"source_image" required:"true"`
SourceImage string `mapstructure:"source_image" required:"true"`
// The name of the resulting image. Defaults to
// "packer-{{timestamp}}"
// (see configuration templates for more info).
ImageName string `mapstructure:"image_name" required:"false"`
// "packer-{{timestamp}}"
// (see configuration templates for more info).
ImageName string `mapstructure:"image_name" required:"false"`
// The description of the resulting image.
ImageDescription string `mapstructure:"image_description" required:"false"`
ImageDescription string `mapstructure:"image_description" required:"false"`
// Key/value pair tags to
// add to the created image.
ImageTags map[string]interface{} `mapstructure:"image_tags" required:"false"`
// add to the created image.
ImageTags map[string]interface{} `mapstructure:"image_tags" required:"false"`
// The service of the resulting image.
ImageService string `mapstructure:"image_service" required:"false"`
ImageService string `mapstructure:"image_service" required:"false"`
// ID or name of the type this server should be created with.
VmType string `mapstructure:"vm_type" required:"true"`
VmType string `mapstructure:"vm_type" required:"true"`
// The name of the created server.
VmName string `mapstructure:"vm_name" required:"false"`
VmName string `mapstructure:"vm_name" required:"false"`
// Key/value pair tags to
// add to the created server.
// add to the created server.
VmTags map[string]interface{} `mapstructure:"vm_tags" required:"false"`
// The name of the created disk.
DiskName string `mapstructure:"disk_name" required:"false"`
DiskName string `mapstructure:"disk_name" required:"false"`
// The type of the created disk. Defaults to ssd.
DiskType string `mapstructure:"disk_type" required:"false"`
DiskType string `mapstructure:"disk_type" required:"false"`
// Size of the created disk, in GiB.
DiskSize float32 `mapstructure:"disk_size" required:"true"`
// The ID of the network to attach to the created server.
Network string `mapstructure:"network" required:"false"`
Network string `mapstructure:"network" required:"false"`
// The ID of the private IP within chosen network
// that should be assigned to the created server.
PrivateIP string `mapstructure:"private_ip" required:"false"`
// that should be assigned to the created server.
PrivateIP string `mapstructure:"private_ip" required:"false"`
// The ID of the public IP that should be assigned to
// the created server. If network is chosen, the public IP will be associated
// with server's private IP.
PublicIP string `mapstructure:"public_ip" required:"false"`
// the created server. If network is chosen, the public IP will be associated
// with server's private IP.
PublicIP string `mapstructure:"public_ip" required:"false"`
// Custom service of public network adapter.
// Can be useful when using custom api_url. Defaults to public.
// Can be useful when using custom api_url. Defaults to public.
PublicNetAdpService string `mapstructure:"public_netadp_service" required:"false"`
ChrootDisk bool `mapstructure:"chroot_disk"`
@ -103,12 +103,12 @@ type Config struct {
PreMountCommands []string `mapstructure:"pre_mount_commands"`
PostMountCommands []string `mapstructure:"post_mount_commands"`
// List of SSH keys by name or id to be added
// to the server on launch.
SSHKeys []string `mapstructure:"ssh_keys" required:"false"`
// to the server on launch.
SSHKeys []string `mapstructure:"ssh_keys" required:"false"`
// User data to launch with the server. Packer will not
// automatically wait for a user script to finish before shutting down the
// instance, this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// automatically wait for a user script to finish before shutting down the
// instance, this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
ctx interpolate.Context
}

View File

@ -11,12 +11,12 @@ import (
type OutputConfig struct {
// This setting specifies the directory that
// artifacts from the build, such as the virtual machine files and disks,
// will be output to. The path to the directory may be relative or
// absolute. If relative, the path is relative to the working directory
// packer is executed from. This directory must not exist or, if
// created, must be empty prior to running the builder. By default this is
// "output-BUILDNAME" where "BUILDNAME" is the name of the build.
// artifacts from the build, such as the virtual machine files and disks,
// will be output to. The path to the directory may be relative or
// absolute. If relative, the path is relative to the working directory
// packer is executed from. This directory must not exist or, if
// created, must be empty prior to running the builder. By default this is
// "output-BUILDNAME" where "BUILDNAME" is the name of the build.
OutputDir string `mapstructure:"output_directory" required:"false"`
}

View File

@ -11,18 +11,18 @@ import (
type ShutdownConfig struct {
// The command to use to gracefully shut down
// the machine once all provisioning is complete. By default this is an
// empty string, which tells Packer to just forcefully shut down the
// machine. This setting can be safely omitted if for example, a shutdown
// command to gracefully halt the machine is configured inside a
// provisioning script. If one or more scripts require a reboot it is
// suggested to leave this blank (since reboots may fail) and instead
// specify the final shutdown command in your last script.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// the machine once all provisioning is complete. By default this is an
// empty string, which tells Packer to just forcefully shut down the
// machine. This setting can be safely omitted if for example, a shutdown
// command to gracefully halt the machine is configured inside a
// provisioning script. If one or more scripts require a reboot it is
// suggested to leave this blank (since reboots may fail) and instead
// specify the final shutdown command in your last script.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// The amount of time to wait after executing
// the shutdown_command for the virtual machine to actually shut down.
// If the machine doesn't shut down in this time it is considered an
// error. By default, the time out is "5m" (five minutes).
// the shutdown_command for the virtual machine to actually shut down.
// If the machine doesn't shut down in this time it is considered an
// error. By default, the time out is "5m" (five minutes).
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
ShutdownTimeout time.Duration ``

View File

@ -61,131 +61,131 @@ type Config struct {
hypervcommon.SSHConfig `mapstructure:",squash"`
hypervcommon.ShutdownConfig `mapstructure:",squash"`
// The size, in megabytes, of the hard disk to create
// for the VM. By default, this is 40 GB.
// for the VM. By default, this is 40 GB.
DiskSize uint `mapstructure:"disk_size" required:"false"`
// The block size of the VHD to be created.
// Recommended disk block size for Linux hyper-v guests is 1 MiB. This
// defaults to "32 MiB".
// Recommended disk block size for Linux hyper-v guests is 1 MiB. This
// defaults to "32 MiB".
DiskBlockSize uint `mapstructure:"disk_block_size" required:"false"`
// The amount, in megabytes, of RAM to assign to the
// VM. By default, this is 1 GB.
// VM. By default, this is 1 GB.
RamSize uint `mapstructure:"memory" required:"false"`
// A list of ISO paths to
// attach to a VM when it is booted. This is most useful for unattended
// Windows installs, which look for an Autounattend.xml file on removable
// media. By default, no secondary ISO will be attached.
// attach to a VM when it is booted. This is most useful for unattended
// Windows installs, which look for an Autounattend.xml file on removable
// media. By default, no secondary ISO will be attached.
SecondaryDvdImages []string `mapstructure:"secondary_iso_images" required:"false"`
// If set to attach then attach and
// mount the ISO image specified in guest_additions_path. If set to
// none then guest additions are not attached and mounted; This is the
// default.
// mount the ISO image specified in guest_additions_path. If set to
// none then guest additions are not attached and mounted; This is the
// default.
GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"`
// The path to the ISO image for guest
// additions.
// additions.
GuestAdditionsPath string `mapstructure:"guest_additions_path" required:"false"`
// This is the name of the new virtual machine,
// without the file extension. By default this is "packer-BUILDNAME",
// where "BUILDNAME" is the name of the build.
// without the file extension. By default this is "packer-BUILDNAME",
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// The name of the switch to connect the virtual
// machine to. By default, leaving this value unset will cause Packer to
// try and determine the switch to use by looking for an external switch
// that is up and running.
SwitchName string `mapstructure:"switch_name" required:"false"`
// machine to. By default, leaving this value unset will cause Packer to
// try and determine the switch to use by looking for an external switch
// that is up and running.
SwitchName string `mapstructure:"switch_name" required:"false"`
// This is the VLAN of the virtual switch's
// network card. By default none is set. If none is set then a VLAN is not
// set on the switch's network card. If this value is set it should match
// the VLAN specified in by vlan_id.
SwitchVlanId string `mapstructure:"switch_vlan_id" required:"false"`
// network card. By default none is set. If none is set then a VLAN is not
// set on the switch's network card. If this value is set it should match
// the VLAN specified in by vlan_id.
SwitchVlanId string `mapstructure:"switch_vlan_id" required:"false"`
// This allows a specific MAC address to be used on
// the default virtual network card. The MAC address must be a string with
// no delimiters, for example "0000deadbeef".
MacAddress string `mapstructure:"mac_address" required:"false"`
// the default virtual network card. The MAC address must be a string with
// no delimiters, for example "0000deadbeef".
MacAddress string `mapstructure:"mac_address" required:"false"`
// This is the VLAN of the virtual machine's network
// card for the new virtual machine. By default none is set. If none is set
// then VLANs are not set on the virtual machine's network card.
VlanId string `mapstructure:"vlan_id" required:"false"`
// card for the new virtual machine. By default none is set. If none is set
// then VLANs are not set on the virtual machine's network card.
VlanId string `mapstructure:"vlan_id" required:"false"`
// The number of CPUs the virtual machine should use. If
// this isn't specified, the default is 1 CPU.
Cpu uint `mapstructure:"cpus" required:"false"`
// this isn't specified, the default is 1 CPU.
Cpu uint `mapstructure:"cpus" required:"false"`
// The Hyper-V generation for the virtual machine. By
// default, this is 1. Generation 2 Hyper-V virtual machines do not support
// floppy drives. In this scenario use secondary_iso_images instead. Hard
// drives and DVD drives will also be SCSI and not IDE.
Generation uint `mapstructure:"generation" required:"false"`
// default, this is 1. Generation 2 Hyper-V virtual machines do not support
// floppy drives. In this scenario use secondary_iso_images instead. Hard
// drives and DVD drives will also be SCSI and not IDE.
Generation uint `mapstructure:"generation" required:"false"`
// If true enable MAC address spoofing
// for the virtual machine. This defaults to false.
EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing" required:"false"`
// for the virtual machine. This defaults to false.
EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing" required:"false"`
// If true use a legacy network adapter as the NIC.
// This defaults to false. A legacy network adapter is fully emulated NIC, and is thus
// supported by various exotic operating systems, but this emulation requires
// additional overhead and should only be used if absolutely necessary.
UseLegacyNetworkAdapter bool `mapstructure:"use_legacy_network_adapter" required:"false"`
// This defaults to false. A legacy network adapter is fully emulated NIC, and is thus
// supported by various exotic operating systems, but this emulation requires
// additional overhead and should only be used if absolutely necessary.
UseLegacyNetworkAdapter bool `mapstructure:"use_legacy_network_adapter" required:"false"`
// If true enable dynamic memory for
// the virtual machine. This defaults to false.
EnableDynamicMemory bool `mapstructure:"enable_dynamic_memory" required:"false"`
// the virtual machine. This defaults to false.
EnableDynamicMemory bool `mapstructure:"enable_dynamic_memory" required:"false"`
// If true enable secure boot for the
// virtual machine. This defaults to false. See secure_boot_template
// below for additional settings.
EnableSecureBoot bool `mapstructure:"enable_secure_boot" required:"false"`
// virtual machine. This defaults to false. See secure_boot_template
// below for additional settings.
EnableSecureBoot bool `mapstructure:"enable_secure_boot" required:"false"`
// The secure boot template to be
// configured. Valid values are "MicrosoftWindows" (Windows) or
// "MicrosoftUEFICertificateAuthority" (Linux). This only takes effect if
// enable_secure_boot is set to "true". This defaults to "MicrosoftWindows".
SecureBootTemplate string `mapstructure:"secure_boot_template" required:"false"`
// configured. Valid values are "MicrosoftWindows" (Windows) or
// "MicrosoftUEFICertificateAuthority" (Linux). This only takes effect if
// enable_secure_boot is set to "true". This defaults to "MicrosoftWindows".
SecureBootTemplate string `mapstructure:"secure_boot_template" required:"false"`
// If true enable
// virtualization extensions for the virtual machine. This defaults to
// false. For nested virtualization you need to enable MAC spoofing,
// disable dynamic memory and have at least 4GB of RAM assigned to the
// virtual machine.
EnableVirtualizationExtensions bool `mapstructure:"enable_virtualization_extensions" required:"false"`
// virtualization extensions for the virtual machine. This defaults to
// false. For nested virtualization you need to enable MAC spoofing,
// disable dynamic memory and have at least 4GB of RAM assigned to the
// virtual machine.
EnableVirtualizationExtensions bool `mapstructure:"enable_virtualization_extensions" required:"false"`
// The location under which Packer will create a
// directory to house all the VM files and folders during the build.
// By default %TEMP% is used which, for most systems, will evaluate to
// %USERPROFILE%/AppData/Local/Temp.
TempPath string `mapstructure:"temp_path" required:"false"`
// directory to house all the VM files and folders during the build.
// By default %TEMP% is used which, for most systems, will evaluate to
// %USERPROFILE%/AppData/Local/Temp.
TempPath string `mapstructure:"temp_path" required:"false"`
// This allows you to set the vm version when
// calling New-VM to generate the vm.
Version string `mapstructure:"configuration_version" required:"false"`
// calling New-VM to generate the vm.
Version string `mapstructure:"configuration_version" required:"false"`
// If "true", Packer will not delete the VM from
// The Hyper-V manager.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
// The Hyper-V manager.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
Communicator string `mapstructure:"communicator"`
// The size or sizes of any
// additional hard disks for the VM in megabytes. If this is not specified
// then the VM will only contain a primary hard disk. Additional drives
// will be attached to the SCSI interface only. The builder uses
// expandable rather than fixed-size virtual hard disks, so the actual
// file representing the disk will not use the full size unless it is
// full.
// additional hard disks for the VM in megabytes. If this is not specified
// then the VM will only contain a primary hard disk. Additional drives
// will be attached to the SCSI interface only. The builder uses
// expandable rather than fixed-size virtual hard disks, so the actual
// file representing the disk will not use the full size unless it is
// full.
AdditionalDiskSize []uint `mapstructure:"disk_additional_size" required:"false"`
// If true skip compacting the hard disk for
// the virtual machine when exporting. This defaults to false.
// the virtual machine when exporting. This defaults to false.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// If true Packer will skip the export of the VM.
// If you are interested only in the VHD/VHDX files, you can enable this
// option. The resulting VHD/VHDX file will be output to
// <output_directory>/Virtual Hard Disks. By default this option is false
// and Packer will export the VM to output_directory.
// If you are interested only in the VHD/VHDX files, you can enable this
// option. The resulting VHD/VHDX file will be output to
// <output_directory>/Virtual Hard Disks. By default this option is false
// and Packer will export the VM to output_directory.
SkipExport bool `mapstructure:"skip_export" required:"false"`
// If true enables differencing disks. Only
// the changes will be written to the new disk. This is especially useful if
// your source is a VHD/VHDX. This defaults to false.
// the changes will be written to the new disk. This is especially useful if
// your source is a VHD/VHDX. This defaults to false.
DifferencingDisk bool `mapstructure:"differencing_disk" required:"false"`
// If true, creates the boot disk on the
// virtual machine as a fixed VHD format disk. The default is false, which
// creates a dynamic VHDX format disk. This option requires setting
// generation to 1, skip_compaction to true, and
// differencing_disk to false. Additionally, any value entered for
// disk_block_size will be ignored. The most likely use case for this
// option is outputing a disk that is in the format required for upload to
// Azure.
// virtual machine as a fixed VHD format disk. The default is false, which
// creates a dynamic VHDX format disk. This option requires setting
// generation to 1, skip_compaction to true, and
// differencing_disk to false. Additionally, any value entered for
// disk_block_size will be ignored. The most likely use case for this
// option is outputing a disk that is in the format required for upload to
// Azure.
FixedVHD bool `mapstructure:"use_fixed_vhd_format" required:"false"`
// Packer defaults to building Hyper-V virtual
// machines by launching a GUI that shows the console of the machine being
// built. When this value is set to true, the machine will start without a
// console.
// machines by launching a GUI that shows the console of the machine being
// built. When this value is set to true, the machine will start without a
// console.
Headless bool `mapstructure:"headless" required:"false"`
ctx interpolate.Context

View File

@ -51,20 +51,20 @@ type Config struct {
hypervcommon.SSHConfig `mapstructure:",squash"`
hypervcommon.ShutdownConfig `mapstructure:",squash"`
// The amount, in megabytes, of RAM to assign to the
// VM. By default, this is 1 GB.
// VM. By default, this is 1 GB.
RamSize uint `mapstructure:"memory" required:"false"`
// A list of ISO paths to
// attach to a VM when it is booted. This is most useful for unattended
// Windows installs, which look for an Autounattend.xml file on removable
// media. By default, no secondary ISO will be attached.
// attach to a VM when it is booted. This is most useful for unattended
// Windows installs, which look for an Autounattend.xml file on removable
// media. By default, no secondary ISO will be attached.
SecondaryDvdImages []string `mapstructure:"secondary_iso_images" required:"false"`
// If set to attach then attach and
// mount the ISO image specified in guest_additions_path. If set to
// none then guest additions are not attached and mounted; This is the
// default.
// mount the ISO image specified in guest_additions_path. If set to
// none then guest additions are not attached and mounted; This is the
// default.
GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"`
// The path to the ISO image for guest
// additions.
// additions.
GuestAdditionsPath string `mapstructure:"guest_additions_path" required:"false"`
// This is the path to a directory containing an exported virtual machine.
@ -73,100 +73,100 @@ type Config struct {
// This is the name of the virtual machine to clone from.
CloneFromVMName string `mapstructure:"clone_from_vm_name"`
// The name of a snapshot in the
// source machine to use as a starting point for the clone. If the value
// given is an empty string, the last snapshot present in the source will
// be chosen as the starting point for the new VM.
// source machine to use as a starting point for the clone. If the value
// given is an empty string, the last snapshot present in the source will
// be chosen as the starting point for the new VM.
CloneFromSnapshotName string `mapstructure:"clone_from_snapshot_name" required:"false"`
// If set to true all snapshots
// present in the source machine will be copied when the machine is
// cloned. The final result of the build will be an exported virtual
// machine that contains all the snapshots of the parent.
// present in the source machine will be copied when the machine is
// cloned. The final result of the build will be an exported virtual
// machine that contains all the snapshots of the parent.
CloneAllSnapshots bool `mapstructure:"clone_all_snapshots" required:"false"`
// This is the name of the new virtual machine,
// without the file extension. By default this is "packer-BUILDNAME",
// where "BUILDNAME" is the name of the build.
// without the file extension. By default this is "packer-BUILDNAME",
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// If true enables differencing disks. Only
// the changes will be written to the new disk. This is especially useful if
// your source is a VHD/VHDX. This defaults to false.
// the changes will be written to the new disk. This is especially useful if
// your source is a VHD/VHDX. This defaults to false.
DifferencingDisk bool `mapstructure:"differencing_disk" required:"false"`
// The name of the switch to connect the virtual
// machine to. By default, leaving this value unset will cause Packer to
// try and determine the switch to use by looking for an external switch
// that is up and running.
SwitchName string `mapstructure:"switch_name" required:"false"`
// machine to. By default, leaving this value unset will cause Packer to
// try and determine the switch to use by looking for an external switch
// that is up and running.
SwitchName string `mapstructure:"switch_name" required:"false"`
// When cloning a vm to build from, we run a powershell
// Compare-VM command, which, depending on your version of Windows, may need
// the "Copy" flag to be set to true or false. Defaults to "false". Command:
CompareCopy bool `mapstructure:"copy_in_compare" required:"false"`
// Compare-VM command, which, depending on your version of Windows, may need
// the "Copy" flag to be set to true or false. Defaults to "false". Command:
CompareCopy bool `mapstructure:"copy_in_compare" required:"false"`
// This is the VLAN of the virtual switch's
// network card. By default none is set. If none is set then a VLAN is not
// set on the switch's network card. If this value is set it should match
// the VLAN specified in by vlan_id.
SwitchVlanId string `mapstructure:"switch_vlan_id" required:"false"`
// network card. By default none is set. If none is set then a VLAN is not
// set on the switch's network card. If this value is set it should match
// the VLAN specified in by vlan_id.
SwitchVlanId string `mapstructure:"switch_vlan_id" required:"false"`
// This allows a specific MAC address to be used on
// the default virtual network card. The MAC address must be a string with
// no delimiters, for example "0000deadbeef".
MacAddress string `mapstructure:"mac_address" required:"false"`
// the default virtual network card. The MAC address must be a string with
// no delimiters, for example "0000deadbeef".
MacAddress string `mapstructure:"mac_address" required:"false"`
// This is the VLAN of the virtual machine's network
// card for the new virtual machine. By default none is set. If none is set
// then VLANs are not set on the virtual machine's network card.
VlanId string `mapstructure:"vlan_id" required:"false"`
// card for the new virtual machine. By default none is set. If none is set
// then VLANs are not set on the virtual machine's network card.
VlanId string `mapstructure:"vlan_id" required:"false"`
// The number of CPUs the virtual machine should use. If
// this isn't specified, the default is 1 CPU.
Cpu uint `mapstructure:"cpus" required:"false"`
// this isn't specified, the default is 1 CPU.
Cpu uint `mapstructure:"cpus" required:"false"`
// The Hyper-V generation for the virtual machine. By
// default, this is 1. Generation 2 Hyper-V virtual machines do not support
// floppy drives. In this scenario use secondary_iso_images instead. Hard
// drives and DVD drives will also be SCSI and not IDE.
Generation uint `mapstructure:"generation" required:"false"`
// default, this is 1. Generation 2 Hyper-V virtual machines do not support
// floppy drives. In this scenario use secondary_iso_images instead. Hard
// drives and DVD drives will also be SCSI and not IDE.
Generation uint `mapstructure:"generation" required:"false"`
// If true enable MAC address spoofing
// for the virtual machine. This defaults to false.
EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing" required:"false"`
// for the virtual machine. This defaults to false.
EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing" required:"false"`
// If true enable dynamic memory for
// the virtual machine. This defaults to false.
EnableDynamicMemory bool `mapstructure:"enable_dynamic_memory" required:"false"`
// the virtual machine. This defaults to false.
EnableDynamicMemory bool `mapstructure:"enable_dynamic_memory" required:"false"`
// If true enable secure boot for the
// virtual machine. This defaults to false. See secure_boot_template
// below for additional settings.
EnableSecureBoot bool `mapstructure:"enable_secure_boot" required:"false"`
// virtual machine. This defaults to false. See secure_boot_template
// below for additional settings.
EnableSecureBoot bool `mapstructure:"enable_secure_boot" required:"false"`
// The secure boot template to be
// configured. Valid values are "MicrosoftWindows" (Windows) or
// "MicrosoftUEFICertificateAuthority" (Linux). This only takes effect if
// enable_secure_boot is set to "true". This defaults to "MicrosoftWindows".
SecureBootTemplate string `mapstructure:"secure_boot_template" required:"false"`
// configured. Valid values are "MicrosoftWindows" (Windows) or
// "MicrosoftUEFICertificateAuthority" (Linux). This only takes effect if
// enable_secure_boot is set to "true". This defaults to "MicrosoftWindows".
SecureBootTemplate string `mapstructure:"secure_boot_template" required:"false"`
// If true enable
// virtualization extensions for the virtual machine. This defaults to
// false. For nested virtualization you need to enable MAC spoofing,
// disable dynamic memory and have at least 4GB of RAM assigned to the
// virtual machine.
EnableVirtualizationExtensions bool `mapstructure:"enable_virtualization_extensions" required:"false"`
// virtualization extensions for the virtual machine. This defaults to
// false. For nested virtualization you need to enable MAC spoofing,
// disable dynamic memory and have at least 4GB of RAM assigned to the
// virtual machine.
EnableVirtualizationExtensions bool `mapstructure:"enable_virtualization_extensions" required:"false"`
// The location under which Packer will create a
// directory to house all the VM files and folders during the build.
// By default %TEMP% is used which, for most systems, will evaluate to
// %USERPROFILE%/AppData/Local/Temp.
TempPath string `mapstructure:"temp_path" required:"false"`
// directory to house all the VM files and folders during the build.
// By default %TEMP% is used which, for most systems, will evaluate to
// %USERPROFILE%/AppData/Local/Temp.
TempPath string `mapstructure:"temp_path" required:"false"`
// This allows you to set the vm version when
// calling New-VM to generate the vm.
Version string `mapstructure:"configuration_version" required:"false"`
// calling New-VM to generate the vm.
Version string `mapstructure:"configuration_version" required:"false"`
// If "true", Packer will not delete the VM from
// The Hyper-V manager.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
// The Hyper-V manager.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
Communicator string `mapstructure:"communicator"`
// If true skip compacting the hard disk for
// the virtual machine when exporting. This defaults to false.
// the virtual machine when exporting. This defaults to false.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// If true Packer will skip the export of the VM.
// If you are interested only in the VHD/VHDX files, you can enable this
// option. The resulting VHD/VHDX file will be output to
// <output_directory>/Virtual Hard Disks. By default this option is false
// and Packer will export the VM to output_directory.
// If you are interested only in the VHD/VHDX files, you can enable this
// option. The resulting VHD/VHDX file will be output to
// <output_directory>/Virtual Hard Disks. By default this option is false
// and Packer will export the VM to output_directory.
SkipExport bool `mapstructure:"skip_export" required:"false"`
// Packer defaults to building Hyper-V virtual
// machines by launching a GUI that shows the console of the machine being
// built. When this value is set to true, the machine will start without a
// console.
// machines by launching a GUI that shows the console of the machine being
// built. When this value is set to true, the machine will start without a
// console.
Headless bool `mapstructure:"headless" required:"false"`
ctx interpolate.Context

View File

@ -17,52 +17,52 @@ import (
type Config struct {
common.PackerConfig `mapstructure:",squash"`
// The path to the lxc configuration file.
ConfigFile string `mapstructure:"config_file" required:"true"`
ConfigFile string `mapstructure:"config_file" required:"true"`
// The directory in which to save the exported
// tar.gz. Defaults to output-<BuildName> in the current directory.
OutputDir string `mapstructure:"output_directory" required:"false"`
// tar.gz. Defaults to output-<BuildName> in the current directory.
OutputDir string `mapstructure:"output_directory" required:"false"`
// The name of the LXC container. Usually stored
// in /var/lib/lxc/containers/<container_name>. Defaults to
// packer-<BuildName>.
ContainerName string `mapstructure:"container_name" required:"false"`
// in /var/lib/lxc/containers/<container_name>. Defaults to
// packer-<BuildName>.
ContainerName string `mapstructure:"container_name" required:"false"`
// Allows you to specify a wrapper command, such
// as ssh so you can execute packer builds on a remote host. Defaults to
// Empty.
CommandWrapper string `mapstructure:"command_wrapper" required:"false"`
// as ssh so you can execute packer builds on a remote host. Defaults to
// Empty.
CommandWrapper string `mapstructure:"command_wrapper" required:"false"`
// The timeout in seconds to wait for the the
// container to start. Defaults to 20 seconds.
RawInitTimeout string `mapstructure:"init_timeout" required:"false"`
// container to start. Defaults to 20 seconds.
RawInitTimeout string `mapstructure:"init_timeout" required:"false"`
// Options to pass to lxc-create. For
// instance, you can specify a custom LXC container configuration file with
// ["-f", "/path/to/lxc.conf"]. Defaults to []. See man 1 lxc-create for
// available options.
CreateOptions []string `mapstructure:"create_options" required:"false"`
// instance, you can specify a custom LXC container configuration file with
// ["-f", "/path/to/lxc.conf"]. Defaults to []. See man 1 lxc-create for
// available options.
CreateOptions []string `mapstructure:"create_options" required:"false"`
// Options to pass to lxc-start. For
// instance, you can override parameters from the LXC container configuration
// file via ["--define", "KEY=VALUE"]. Defaults to []. See
// man 1 lxc-start for available options.
StartOptions []string `mapstructure:"start_options" required:"false"`
// instance, you can override parameters from the LXC container configuration
// file via ["--define", "KEY=VALUE"]. Defaults to []. See
// man 1 lxc-start for available options.
StartOptions []string `mapstructure:"start_options" required:"false"`
// Options to pass to lxc-attach. For
// instance, you can prevent the container from inheriting the host machine's
// environment by specifying ["--clear-env"]. Defaults to []. See
// man 1 lxc-attach for available options.
AttachOptions []string `mapstructure:"attach_options" required:"false"`
// instance, you can prevent the container from inheriting the host machine's
// environment by specifying ["--clear-env"]. Defaults to []. See
// man 1 lxc-attach for available options.
AttachOptions []string `mapstructure:"attach_options" required:"false"`
// The LXC template name to use.
Name string `mapstructure:"template_name" required:"true"`
Name string `mapstructure:"template_name" required:"true"`
// Options to pass to the given
// lxc-template command, usually located in
// /usr/share/lxc/templates/lxc-<template_name>. Note: This gets passed as
// ARGV to the template command. Ensure you have an array of strings, as a
// single string with spaces probably won't work. Defaults to [].
Parameters []string `mapstructure:"template_parameters" required:"false"`
// lxc-template command, usually located in
// /usr/share/lxc/templates/lxc-<template_name>. Note: This gets passed as
// ARGV to the template command. Ensure you have an array of strings, as a
// single string with spaces probably won't work. Defaults to [].
Parameters []string `mapstructure:"template_parameters" required:"false"`
// Environmental variables to
// use to build the template with.
EnvVars []string `mapstructure:"template_environment_vars" required:"true"`
// use to build the template with.
EnvVars []string `mapstructure:"template_environment_vars" required:"true"`
// The minimum run level to wait for the
// container to reach. Note some distributions (Ubuntu) simulate run levels
// and may report 5 rather than 3.
TargetRunlevel int `mapstructure:"target_runlevel" required:"false"`
InitTimeout time.Duration
// container to reach. Note some distributions (Ubuntu) simulate run levels
// and may report 5 rather than 3.
TargetRunlevel int `mapstructure:"target_runlevel" required:"false"`
InitTimeout time.Duration
ctx interpolate.Context
}

View File

@ -15,29 +15,29 @@ import (
type Config struct {
common.PackerConfig `mapstructure:",squash"`
// The name of the output artifact. Defaults to
// name.
OutputImage string `mapstructure:"output_image" required:"false"`
ContainerName string `mapstructure:"container_name"`
// name.
OutputImage string `mapstructure:"output_image" required:"false"`
ContainerName string `mapstructure:"container_name"`
// Lets you prefix all builder commands, such as
// with ssh for a remote build host. Defaults to "".
CommandWrapper string `mapstructure:"command_wrapper" required:"false"`
// with ssh for a remote build host. Defaults to "".
CommandWrapper string `mapstructure:"command_wrapper" required:"false"`
// The source image to use when creating the build
// container. This can be a (local or remote) image (name or fingerprint).
// E.G. my-base-image, ubuntu-daily:x, 08fababf6f27, ...
Image string `mapstructure:"image" required:"true"`
Profile string `mapstructure:"profile"`
// container. This can be a (local or remote) image (name or fingerprint).
// E.G. my-base-image, ubuntu-daily:x, 08fababf6f27, ...
Image string `mapstructure:"image" required:"true"`
Profile string `mapstructure:"profile"`
// The number of seconds to sleep between launching
// the LXD instance and provisioning it; defaults to 3 seconds.
InitSleep string `mapstructure:"init_sleep" required:"false"`
// the LXD instance and provisioning it; defaults to 3 seconds.
InitSleep string `mapstructure:"init_sleep" required:"false"`
// Pass key values to the publish
// step to be set as properties on the output image. This is most helpful to
// set the description, but can be used to set anything needed. See
// https://stgraber.org/2016/03/30/lxd-2-0-image-management-512/
// for more properties.
PublishProperties map[string]string `mapstructure:"publish_properties" required:"false"`
// step to be set as properties on the output image. This is most helpful to
// set the description, but can be used to set anything needed. See
// https://stgraber.org/2016/03/30/lxd-2-0-image-management-512/
// for more properties.
PublishProperties map[string]string `mapstructure:"publish_properties" required:"false"`
// List of key/value pairs you wish to
// pass to lxc launch via --config. Defaults to empty.
LaunchConfig map[string]string `mapstructure:"launch_config" required:"false"`
// pass to lxc launch via --config. Defaults to empty.
LaunchConfig map[string]string `mapstructure:"launch_config" required:"false"`
ctx interpolate.Context
}

View File

@ -18,40 +18,40 @@ import (
type Config struct {
common.PackerConfig `mapstructure:",squash"`
AccessKey string `mapstructure:"access_key"`
SecretKey string `mapstructure:"secret_key"`
AccessKey string `mapstructure:"access_key"`
SecretKey string `mapstructure:"secret_key"`
// Product code of an image to create.
// (member_server_image_no is required if not specified)
ServerImageProductCode string `mapstructure:"server_image_product_code" required:"true"`
// (member_server_image_no is required if not specified)
ServerImageProductCode string `mapstructure:"server_image_product_code" required:"true"`
// Product (spec) code to create.
ServerProductCode string `mapstructure:"server_product_code" required:"true"`
ServerProductCode string `mapstructure:"server_product_code" required:"true"`
// Previous image code. If there is an
// image previously created, it can be used to create a new image.
// (server_image_product_code is required if not specified)
MemberServerImageNo string `mapstructure:"member_server_image_no" required:"false"`
// image previously created, it can be used to create a new image.
// (server_image_product_code is required if not specified)
MemberServerImageNo string `mapstructure:"member_server_image_no" required:"false"`
// Name of an image to create.
ServerImageName string `mapstructure:"server_image_name" required:"false"`
ServerImageName string `mapstructure:"server_image_name" required:"false"`
// Description of an image to create.
ServerImageDescription string `mapstructure:"server_image_description" required:"false"`
ServerImageDescription string `mapstructure:"server_image_description" required:"false"`
// User data to apply when launching the instance. Note
// that you need to be careful about escaping characters due to the templates
// being JSON. It is often more convenient to use user_data_file, instead.
// Packer will not automatically wait for a user script to finish before
// shutting down the instance this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// that you need to be careful about escaping characters due to the templates
// being JSON. It is often more convenient to use user_data_file, instead.
// Packer will not automatically wait for a user script to finish before
// shutting down the instance this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// Path to a file that will be used for the user
// data when launching the instance.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// data when launching the instance.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// You can add block storage ranging from 10
// GB to 2000 GB, in increments of 10 GB.
BlockStorageSize int `mapstructure:"block_storage_size" required:"false"`
// GB to 2000 GB, in increments of 10 GB.
BlockStorageSize int `mapstructure:"block_storage_size" required:"false"`
// Name of the region where you want to create an image.
// (default: Korea)
Region string `mapstructure:"region" required:"false"`
// (default: Korea)
Region string `mapstructure:"region" required:"false"`
// This is used to allow
// winrm access when you create a Windows server. An ACG that specifies an
// access source (0.0.0.0/0) and allowed port (5985) must be created in
// advance.
// winrm access when you create a Windows server. An ACG that specifies an
// access source (0.0.0.0/0) and allowed port (5985) must be created in
// advance.
AccessControlGroupConfigurationNo string `mapstructure:"access_control_group_configuration_no" required:"false"`
Comm communicator.Config `mapstructure:",squash"`

View File

@ -19,75 +19,75 @@ import (
// AccessConfig is for common configuration related to openstack access
type AccessConfig struct {
// The username or id used to connect to
// the OpenStack service. If not specified, Packer will use the environment
// variable OS_USERNAME or OS_USERID, if set. This is not required if
// using access token or application credential instead of password, or if using
// cloud.yaml.
Username string `mapstructure:"username" required:"true"`
UserID string `mapstructure:"user_id"`
// the OpenStack service. If not specified, Packer will use the environment
// variable OS_USERNAME or OS_USERID, if set. This is not required if
// using access token or application credential instead of password, or if using
// cloud.yaml.
Username string `mapstructure:"username" required:"true"`
UserID string `mapstructure:"user_id"`
// The password used to connect to the OpenStack
// service. If not specified, Packer will use the environment variables
// OS_PASSWORD, if set. This is not required if using access token or
// application credential instead of password, or if using cloud.yaml.
Password string `mapstructure:"password" required:"true"`
// service. If not specified, Packer will use the environment variables
// OS_PASSWORD, if set. This is not required if using access token or
// application credential instead of password, or if using cloud.yaml.
Password string `mapstructure:"password" required:"true"`
// The URL to the OpenStack Identity service.
// If not specified, Packer will use the environment variables OS_AUTH_URL,
// if set. This is not required if using cloud.yaml.
IdentityEndpoint string `mapstructure:"identity_endpoint" required:"true"`
// If not specified, Packer will use the environment variables OS_AUTH_URL,
// if set. This is not required if using cloud.yaml.
IdentityEndpoint string `mapstructure:"identity_endpoint" required:"true"`
// The tenant ID or name to boot the
// instance into. Some OpenStack installations require this. If not specified,
// Packer will use the environment variable OS_TENANT_NAME or
// OS_TENANT_ID, if set. Tenant is also called Project in later versions of
// OpenStack.
TenantID string `mapstructure:"tenant_id" required:"false"`
TenantName string `mapstructure:"tenant_name"`
DomainID string `mapstructure:"domain_id"`
// instance into. Some OpenStack installations require this. If not specified,
// Packer will use the environment variable OS_TENANT_NAME or
// OS_TENANT_ID, if set. Tenant is also called Project in later versions of
// OpenStack.
TenantID string `mapstructure:"tenant_id" required:"false"`
TenantName string `mapstructure:"tenant_name"`
DomainID string `mapstructure:"domain_id"`
// The Domain name or ID you are
// authenticating with. OpenStack installations require this if identity v3 is
// used. Packer will use the environment variable OS_DOMAIN_NAME or
// OS_DOMAIN_ID, if set.
DomainName string `mapstructure:"domain_name" required:"false"`
// authenticating with. OpenStack installations require this if identity v3 is
// used. Packer will use the environment variable OS_DOMAIN_NAME or
// OS_DOMAIN_ID, if set.
DomainName string `mapstructure:"domain_name" required:"false"`
// Whether or not the connection to OpenStack can be
// done over an insecure connection. By default this is false.
Insecure bool `mapstructure:"insecure" required:"false"`
// done over an insecure connection. By default this is false.
Insecure bool `mapstructure:"insecure" required:"false"`
// The name of the region, such as "DFW", in which to
// launch the server to create the image. If not specified, Packer will use
// the environment variable OS_REGION_NAME, if set.
Region string `mapstructure:"region" required:"false"`
// launch the server to create the image. If not specified, Packer will use
// the environment variable OS_REGION_NAME, if set.
Region string `mapstructure:"region" required:"false"`
// The endpoint type to use. Can be any of
// "internal", "internalURL", "admin", "adminURL", "public", and "publicURL".
// By default this is "public".
EndpointType string `mapstructure:"endpoint_type" required:"false"`
// "internal", "internalURL", "admin", "adminURL", "public", and "publicURL".
// By default this is "public".
EndpointType string `mapstructure:"endpoint_type" required:"false"`
// Custom CA certificate file path. If omitted the
// OS_CACERT environment variable can be used.
CACertFile string `mapstructure:"cacert" required:"false"`
// OS_CACERT environment variable can be used.
CACertFile string `mapstructure:"cacert" required:"false"`
// Client certificate file path for SSL client
// authentication. If omitted the OS_CERT environment variable can be used.
ClientCertFile string `mapstructure:"cert" required:"false"`
// authentication. If omitted the OS_CERT environment variable can be used.
ClientCertFile string `mapstructure:"cert" required:"false"`
// Client private key file path for SSL client
// authentication. If omitted the OS_KEY environment variable can be used.
ClientKeyFile string `mapstructure:"key" required:"false"`
// authentication. If omitted the OS_KEY environment variable can be used.
ClientKeyFile string `mapstructure:"key" required:"false"`
// the token (id) to use with token based authorization.
// Packer will use the environment variable OS_TOKEN, if set.
Token string `mapstructure:"token" required:"false"`
// Packer will use the environment variable OS_TOKEN, if set.
Token string `mapstructure:"token" required:"false"`
// The application credential name to
// use with application credential based authorization. Packer will use the
// environment variable OS_APPLICATION_CREDENTIAL_NAME, if set.
ApplicationCredentialName string `mapstructure:"application_credential_name" required:"false"`
// use with application credential based authorization. Packer will use the
// environment variable OS_APPLICATION_CREDENTIAL_NAME, if set.
ApplicationCredentialName string `mapstructure:"application_credential_name" required:"false"`
// The application credential id to
// use with application credential based authorization. Packer will use the
// environment variable OS_APPLICATION_CREDENTIAL_ID, if set.
ApplicationCredentialID string `mapstructure:"application_credential_id" required:"false"`
// use with application credential based authorization. Packer will use the
// environment variable OS_APPLICATION_CREDENTIAL_ID, if set.
ApplicationCredentialID string `mapstructure:"application_credential_id" required:"false"`
// The application credential secret
// to use with application credential based authorization. Packer will use the
// environment variable OS_APPLICATION_CREDENTIAL_SECRET, if set.
// to use with application credential based authorization. Packer will use the
// environment variable OS_APPLICATION_CREDENTIAL_SECRET, if set.
ApplicationCredentialSecret string `mapstructure:"application_credential_secret" required:"false"`
// An entry in a clouds.yaml file. See the OpenStack
// os-client-config
// documentation
// for more information about clouds.yaml files. If omitted, the OS_CLOUD
// environment variable is used.
Cloud string `mapstructure:"cloud" required:"false"`
// os-client-config
// documentation
// for more information about clouds.yaml files. If omitted, the OS_CLOUD
// environment variable is used.
Cloud string `mapstructure:"cloud" required:"false"`
osClient *gophercloud.ProviderClient
}

View File

@ -13,23 +13,23 @@ import (
// ImageConfig is for common configuration related to creating Images.
type ImageConfig struct {
// The name of the resulting image.
ImageName string `mapstructure:"image_name" required:"true"`
ImageName string `mapstructure:"image_name" required:"true"`
// Glance metadata that will be
// applied to the image.
ImageMetadata map[string]string `mapstructure:"metadata" required:"false"`
// applied to the image.
ImageMetadata map[string]string `mapstructure:"metadata" required:"false"`
// One of "public", "private", "shared", or
// "community".
// "community".
ImageVisibility imageservice.ImageVisibility `mapstructure:"image_visibility" required:"false"`
// List of members to add to the image
// after creation. An image member is usually a project (also called the
// "tenant") with whom the image is shared.
ImageMembers []string `mapstructure:"image_members" required:"false"`
// after creation. An image member is usually a project (also called the
// "tenant") with whom the image is shared.
ImageMembers []string `mapstructure:"image_members" required:"false"`
// Disk format of the resulting image. This
// option works if use_blockstorage_volume is true.
ImageDiskFormat string `mapstructure:"image_disk_format" required:"false"`
// option works if use_blockstorage_volume is true.
ImageDiskFormat string `mapstructure:"image_disk_format" required:"false"`
// List of tags to add to the image after
// creation.
ImageTags []string `mapstructure:"image_tags" required:"false"`
// creation.
ImageTags []string `mapstructure:"image_tags" required:"false"`
}
func (c *ImageConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -17,120 +17,120 @@ import (
type RunConfig struct {
Comm communicator.Config `mapstructure:",squash"`
// The ID or full URL to the base image to use. This
// is the image that will be used to launch a new server and provision it.
// Unless you specify completely custom SSH settings, the source image must
// have cloud-init installed so that the keypair gets assigned properly.
SourceImage string `mapstructure:"source_image" required:"true"`
// is the image that will be used to launch a new server and provision it.
// Unless you specify completely custom SSH settings, the source image must
// have cloud-init installed so that the keypair gets assigned properly.
SourceImage string `mapstructure:"source_image" required:"true"`
// The name of the base image to use. This is
// an alternative way of providing source_image and only either of them can
// be specified.
SourceImageName string `mapstructure:"source_image_name" required:"true"`
// an alternative way of providing source_image and only either of them can
// be specified.
SourceImageName string `mapstructure:"source_image_name" required:"true"`
// The search filters for determining the base
// image to use. This is an alternative way of providing source_image and
// only one of these methods can be used. source_image will override the
// filters.
SourceImageFilters ImageFilter `mapstructure:"source_image_filter" required:"true"`
// image to use. This is an alternative way of providing source_image and
// only one of these methods can be used. source_image will override the
// filters.
SourceImageFilters ImageFilter `mapstructure:"source_image_filter" required:"true"`
// The ID, name, or full URL for the desired flavor for
// the server to be created.
Flavor string `mapstructure:"flavor" required:"true"`
// the server to be created.
Flavor string `mapstructure:"flavor" required:"true"`
// The availability zone to launch the server
// in. If this isn't specified, the default enforced by your OpenStack cluster
// will be used. This may be required for some OpenStack clusters.
AvailabilityZone string `mapstructure:"availability_zone" required:"false"`
// in. If this isn't specified, the default enforced by your OpenStack cluster
// will be used. This may be required for some OpenStack clusters.
AvailabilityZone string `mapstructure:"availability_zone" required:"false"`
// For rackspace, whether or not to wait for
// Rackconnect to assign the machine an IP address before connecting via SSH.
// Defaults to false.
RackconnectWait bool `mapstructure:"rackconnect_wait" required:"false"`
// Rackconnect to assign the machine an IP address before connecting via SSH.
// Defaults to false.
RackconnectWait bool `mapstructure:"rackconnect_wait" required:"false"`
// The ID or name of an external network that
// can be used for creation of a new floating IP.
FloatingIPNetwork string `mapstructure:"floating_ip_network" required:"false"`
// can be used for creation of a new floating IP.
FloatingIPNetwork string `mapstructure:"floating_ip_network" required:"false"`
// A specific floating IP to assign to this instance.
FloatingIP string `mapstructure:"floating_ip" required:"false"`
FloatingIP string `mapstructure:"floating_ip" required:"false"`
// Whether or not to attempt to reuse existing
// unassigned floating ips in the project before allocating a new one. Note
// that it is not possible to safely do this concurrently, so if you are
// running multiple openstack builds concurrently, or if other processes are
// assigning and using floating IPs in the same openstack project while packer
// is running, you should not set this to true. Defaults to false.
ReuseIPs bool `mapstructure:"reuse_ips" required:"false"`
// unassigned floating ips in the project before allocating a new one. Note
// that it is not possible to safely do this concurrently, so if you are
// running multiple openstack builds concurrently, or if other processes are
// assigning and using floating IPs in the same openstack project while packer
// is running, you should not set this to true. Defaults to false.
ReuseIPs bool `mapstructure:"reuse_ips" required:"false"`
// A list of security groups by name to
// add to this instance.
SecurityGroups []string `mapstructure:"security_groups" required:"false"`
// add to this instance.
SecurityGroups []string `mapstructure:"security_groups" required:"false"`
// A list of networks by UUID to attach to
// this instance.
Networks []string `mapstructure:"networks" required:"false"`
// this instance.
Networks []string `mapstructure:"networks" required:"false"`
// A list of ports by UUID to attach to this
// instance.
Ports []string `mapstructure:"ports" required:"false"`
// instance.
Ports []string `mapstructure:"ports" required:"false"`
// User data to apply when launching the instance. Note
// that you need to be careful about escaping characters due to the templates
// being JSON. It is often more convenient to use user_data_file, instead.
// Packer will not automatically wait for a user script to finish before
// shutting down the instance this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// that you need to be careful about escaping characters due to the templates
// being JSON. It is often more convenient to use user_data_file, instead.
// Packer will not automatically wait for a user script to finish before
// shutting down the instance this must be handled in a provisioner.
UserData string `mapstructure:"user_data" required:"false"`
// Path to a file that will be used for the user
// data when launching the instance.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// data when launching the instance.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// Name that is applied to the server instance
// created by Packer. If this isn't specified, the default is same as
// image_name.
InstanceName string `mapstructure:"instance_name" required:"false"`
// created by Packer. If this isn't specified, the default is same as
// image_name.
InstanceName string `mapstructure:"instance_name" required:"false"`
// Metadata that is
// applied to the server instance created by Packer. Also called server
// properties in some documentation. The strings have a max size of 255 bytes
// each.
InstanceMetadata map[string]string `mapstructure:"instance_metadata" required:"false"`
// applied to the server instance created by Packer. Also called server
// properties in some documentation. The strings have a max size of 255 bytes
// each.
InstanceMetadata map[string]string `mapstructure:"instance_metadata" required:"false"`
// Whether to force the OpenStack instance to be
// forcefully deleted. This is useful for environments that have
// reclaim / soft deletion enabled. By default this is false.
ForceDelete bool `mapstructure:"force_delete" required:"false"`
// forcefully deleted. This is useful for environments that have
// reclaim / soft deletion enabled. By default this is false.
ForceDelete bool `mapstructure:"force_delete" required:"false"`
// Whether or not nova should use ConfigDrive for
// cloud-init metadata.
// cloud-init metadata.
ConfigDrive bool `mapstructure:"config_drive" required:"false"`
// Deprecated use floating_ip_network
// instead.
// instead.
FloatingIPPool string `mapstructure:"floating_ip_pool" required:"false"`
// Use Block Storage service volume for
// the instance root volume instead of Compute service local volume (default).
UseBlockStorageVolume bool `mapstructure:"use_blockstorage_volume" required:"false"`
// the instance root volume instead of Compute service local volume (default).
UseBlockStorageVolume bool `mapstructure:"use_blockstorage_volume" required:"false"`
// Name of the Block Storage service volume. If this
// isn't specified, random string will be used.
VolumeName string `mapstructure:"volume_name" required:"false"`
// isn't specified, random string will be used.
VolumeName string `mapstructure:"volume_name" required:"false"`
// Type of the Block Storage service volume. If this
// isn't specified, the default enforced by your OpenStack cluster will be
// used.
VolumeType string `mapstructure:"volume_type" required:"false"`
// isn't specified, the default enforced by your OpenStack cluster will be
// used.
VolumeType string `mapstructure:"volume_type" required:"false"`
// Size of the Block Storage service volume in GB. If
// this isn't specified, it is set to source image min disk value (if set) or
// calculated from the source image bytes size. Note that in some cases this
// needs to be specified, if use_blockstorage_volume is true.
VolumeSize int `mapstructure:"volume_size" required:"false"`
// this isn't specified, it is set to source image min disk value (if set) or
// calculated from the source image bytes size. Note that in some cases this
// needs to be specified, if use_blockstorage_volume is true.
VolumeSize int `mapstructure:"volume_size" required:"false"`
// Availability zone of the Block
// Storage service volume. If omitted, Compute instance availability zone will
// be used. If both of Compute instance and Block Storage volume availability
// zones aren't specified, the default enforced by your OpenStack cluster will
// be used.
// Storage service volume. If omitted, Compute instance availability zone will
// be used. If both of Compute instance and Block Storage volume availability
// zones aren't specified, the default enforced by your OpenStack cluster will
// be used.
VolumeAvailabilityZone string `mapstructure:"volume_availability_zone" required:"false"`
// Not really used, but here for BC
OpenstackProvider string `mapstructure:"openstack_provider"`
// Deprecated use floating_ip or
// floating_ip_pool instead.
UseFloatingIp bool `mapstructure:"use_floating_ip" required:"false"`
// floating_ip_pool instead.
UseFloatingIp bool `mapstructure:"use_floating_ip" required:"false"`
sourceImageOpts images.ListOpts
}
type ImageFilter struct {
// filters used to select a source_image.
// NOTE: This will fail unless exactly one image is returned, or
// most_recent is set to true. Of the filters described in
// ImageService, the
// following are valid:
Filters ImageFilterOptions `mapstructure:"filters" required:"false"`
// NOTE: This will fail unless exactly one image is returned, or
// most_recent is set to true. Of the filters described in
// ImageService, the
// following are valid:
Filters ImageFilterOptions `mapstructure:"filters" required:"false"`
// Selects the newest created image when true.
// This is most useful for selecting a daily distro build.
MostRecent bool `mapstructure:"most_recent" required:"false"`
// This is most useful for selecting a daily distro build.
MostRecent bool `mapstructure:"most_recent" required:"false"`
}
type ImageFilterOptions struct {

View File

@ -10,17 +10,17 @@ import (
type HWConfig struct {
// The number of cpus to use for building the VM.
// Defaults to 1.
CpuCount int `mapstructure:"cpus" required:"false"`
// Defaults to 1.
CpuCount int `mapstructure:"cpus" required:"false"`
// The amount of memory to use for building the VM in
// megabytes. Defaults to 512 megabytes.
// megabytes. Defaults to 512 megabytes.
MemorySize int `mapstructure:"memory" required:"false"`
// Specifies whether to enable the sound device when
// building the VM. Defaults to false.
// building the VM. Defaults to false.
Sound bool `mapstructure:"sound" required:"false"`
// Specifies whether to enable the USB bus when building
// the VM. Defaults to false.
USB bool `mapstructure:"usb" required:"false"`
// the VM. Defaults to false.
USB bool `mapstructure:"usb" required:"false"`
}
func (c *HWConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -14,11 +14,11 @@ import (
// OutputConfig contains the configuration for builder's output.
type OutputConfig struct {
// This is the path to the directory where the
// resulting virtual machine will be created. This may be relative or absolute.
// If relative, the path is relative to the working directory when packer
// is executed. This directory must not exist or be empty prior to running
// the builder. By default this is "output-BUILDNAME" where "BUILDNAME" is the
// name of the build.
// resulting virtual machine will be created. This may be relative or absolute.
// If relative, the path is relative to the working directory when packer
// is executed. This directory must not exist or be empty prior to running
// the builder. By default this is "output-BUILDNAME" where "BUILDNAME" is the
// name of the build.
OutputDir string `mapstructure:"output_directory" required:"false"`
}

View File

@ -10,15 +10,15 @@ import (
// before the VM start.
type PrlctlConfig struct {
// Custom prlctl commands to execute
// in order to further customize the virtual machine being created. The value
// of this is an array of commands to execute. The commands are executed in the
// order defined in the template. For each command, the command is defined
// itself as an array of strings, where each string represents a single
// argument on the command-line to prlctl (but excluding prlctl itself).
// Each arg is treated as a configuration
// template, where the Name
// variable is replaced with the VM name. More details on how to use prlctl
// are below.
// in order to further customize the virtual machine being created. The value
// of this is an array of commands to execute. The commands are executed in the
// order defined in the template. For each command, the command is defined
// itself as an array of strings, where each string represents a single
// argument on the command-line to prlctl (but excluding prlctl itself).
// Each arg is treated as a configuration
// template, where the Name
// variable is replaced with the VM name. More details on how to use prlctl
// are below.
Prlctl [][]string `mapstructure:"prlctl" required:"false"`
}

View File

@ -10,8 +10,8 @@ import (
// in the end of artifact build.
type PrlctlPostConfig struct {
// Identical to prlctl, except
// that it is run after the virtual machine is shutdown, and before the virtual
// machine is exported.
// that it is run after the virtual machine is shutdown, and before the virtual
// machine is exported.
PrlctlPost [][]string `mapstructure:"prlctl_post" required:"false"`
}

View File

@ -9,10 +9,10 @@ import (
// PrlctlVersionConfig contains the configuration for `prlctl` version.
type PrlctlVersionConfig struct {
// The path within the virtual machine to
// upload a file that contains the prlctl version that was used to create
// the machine. This information can be useful for provisioning. By default
// this is ".prlctl_version", which will generally upload it into the
// home directory.
// upload a file that contains the prlctl version that was used to create
// the machine. This information can be useful for provisioning. By default
// this is ".prlctl_version", which will generally upload it into the
// home directory.
PrlctlVersionFile string `mapstructure:"prlctl_version_file" required:"false"`
}

View File

@ -12,13 +12,13 @@ import (
// ShutdownConfig contains the configuration for VM shutdown.
type ShutdownConfig struct {
// The command to use to gracefully shut down the
// machine once all the provisioning is done. By default this is an empty
// string, which tells Packer to just forcefully shut down the machine.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// machine once all the provisioning is done. By default this is an empty
// string, which tells Packer to just forcefully shut down the machine.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// The amount of time to wait after executing the
// shutdown_command for the virtual machine to actually shut down. If it
// doesn't shut down in this time, it is an error. By default, the timeout is
// "5m", or five minutes.
// shutdown_command for the virtual machine to actually shut down. If it
// doesn't shut down in this time, it is an error. By default, the timeout is
// "5m", or five minutes.
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
ShutdownTimeout time.Duration ``

View File

@ -20,25 +20,25 @@ const (
// ToolsConfig contains the builder configuration related to Parallels Tools.
type ToolsConfig struct {
// The flavor of the Parallels Tools ISO to
// install into the VM. Valid values are "win", "lin", "mac", "os2"
// and "other". This can be omitted only if parallels_tools_mode
// is "disable".
ParallelsToolsFlavor string `mapstructure:"parallels_tools_flavor" required:"true"`
// install into the VM. Valid values are "win", "lin", "mac", "os2"
// and "other". This can be omitted only if parallels_tools_mode
// is "disable".
ParallelsToolsFlavor string `mapstructure:"parallels_tools_flavor" required:"true"`
// The path in the virtual machine to
// upload Parallels Tools. This only takes effect if parallels_tools_mode
// is "upload". This is a configuration
// template that has a single
// valid variable: Flavor, which will be the value of
// parallels_tools_flavor. By default this is "prl-tools-{{.Flavor}}.iso"
// which should upload into the login directory of the user.
// upload Parallels Tools. This only takes effect if parallels_tools_mode
// is "upload". This is a configuration
// template that has a single
// valid variable: Flavor, which will be the value of
// parallels_tools_flavor. By default this is "prl-tools-{{.Flavor}}.iso"
// which should upload into the login directory of the user.
ParallelsToolsGuestPath string `mapstructure:"parallels_tools_guest_path" required:"false"`
// The method by which Parallels Tools are
// made available to the guest for installation. Valid options are "upload",
// "attach", or "disable". If the mode is "attach" the Parallels Tools ISO will
// be attached as a CD device to the virtual machine. If the mode is "upload"
// the Parallels Tools ISO will be uploaded to the path specified by
// parallels_tools_guest_path. The default value is "upload".
ParallelsToolsMode string `mapstructure:"parallels_tools_mode" required:"false"`
// made available to the guest for installation. Valid options are "upload",
// "attach", or "disable". If the mode is "attach" the Parallels Tools ISO will
// be attached as a CD device to the virtual machine. If the mode is "upload"
// the Parallels Tools ISO will be uploaded to the path specified by
// parallels_tools_guest_path. The default value is "upload".
ParallelsToolsMode string `mapstructure:"parallels_tools_mode" required:"false"`
}
// Prepare validates & sets up configuration options related to Parallels Tools.

View File

@ -39,43 +39,43 @@ type Config struct {
parallelscommon.SSHConfig `mapstructure:",squash"`
parallelscommon.ToolsConfig `mapstructure:",squash"`
// The size, in megabytes, of the hard disk to create
// for the VM. By default, this is 40000 (about 40 GB).
DiskSize uint `mapstructure:"disk_size" required:"false"`
// for the VM. By default, this is 40000 (about 40 GB).
DiskSize uint `mapstructure:"disk_size" required:"false"`
// The type for image file based virtual disk drives,
// defaults to expand. Valid options are expand (expanding disk) that the
// image file is small initially and grows in size as you add data to it, and
// plain (plain disk) that the image file has a fixed size from the moment it
// is created (i.e the space is allocated for the full drive). Plain disks
// perform faster than expanding disks. skip_compaction will be set to true
// automatically for plain disks.
DiskType string `mapstructure:"disk_type" required:"false"`
// defaults to expand. Valid options are expand (expanding disk) that the
// image file is small initially and grows in size as you add data to it, and
// plain (plain disk) that the image file has a fixed size from the moment it
// is created (i.e the space is allocated for the full drive). Plain disks
// perform faster than expanding disks. skip_compaction will be set to true
// automatically for plain disks.
DiskType string `mapstructure:"disk_type" required:"false"`
// The guest OS type being installed. By default
// this is "other", but you can get dramatic performance improvements by
// setting this to the proper value. To view all available values for this run
// prlctl create x --distribution list. Setting the correct value hints to
// Parallels Desktop how to optimize the virtual hardware to work best with
// that operating system.
GuestOSType string `mapstructure:"guest_os_type" required:"false"`
// this is "other", but you can get dramatic performance improvements by
// setting this to the proper value. To view all available values for this run
// prlctl create x --distribution list. Setting the correct value hints to
// Parallels Desktop how to optimize the virtual hardware to work best with
// that operating system.
GuestOSType string `mapstructure:"guest_os_type" required:"false"`
// The type of controller that the hard
// drives are attached to, defaults to "sata". Valid options are "sata", "ide",
// and "scsi".
HardDriveInterface string `mapstructure:"hard_drive_interface" required:"false"`
// drives are attached to, defaults to "sata". Valid options are "sata", "ide",
// and "scsi".
HardDriveInterface string `mapstructure:"hard_drive_interface" required:"false"`
// A list of which interfaces on the
// host should be searched for a IP address. The first IP address found on one
// of these will be used as {{ .HTTPIP }} in the boot_command. Defaults to
// ["en0", "en1", "en2", "en3", "en4", "en5", "en6", "en7", "en8", "en9",
// "ppp0", "ppp1", "ppp2"].
HostInterfaces []string `mapstructure:"host_interfaces" required:"false"`
// host should be searched for a IP address. The first IP address found on one
// of these will be used as {{ .HTTPIP }} in the boot_command. Defaults to
// ["en0", "en1", "en2", "en3", "en4", "en5", "en6", "en7", "en8", "en9",
// "ppp0", "ppp1", "ppp2"].
HostInterfaces []string `mapstructure:"host_interfaces" required:"false"`
// Virtual disk image is compacted at the end of
// the build process using prl_disk_tool utility (except for the case that
// disk_type is set to plain). In certain rare cases, this might corrupt
// the resulting disk image. If you find this to be the case, you can disable
// compaction using this configuration value.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// the build process using prl_disk_tool utility (except for the case that
// disk_type is set to plain). In certain rare cases, this might corrupt
// the resulting disk image. If you find this to be the case, you can disable
// compaction using this configuration value.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// This is the name of the PVM directory for the new
// virtual machine, without the file extension. By default this is
// "packer-BUILDNAME", where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// virtual machine, without the file extension. By default this is
// "packer-BUILDNAME", where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
ctx interpolate.Context
}

View File

@ -27,22 +27,22 @@ type Config struct {
bootcommand.BootConfig `mapstructure:",squash"`
parallelscommon.ToolsConfig `mapstructure:",squash"`
// The path to a PVM directory that acts as the source
// of this build.
SourcePath string `mapstructure:"source_path" required:"true"`
// of this build.
SourcePath string `mapstructure:"source_path" required:"true"`
// Virtual disk image is compacted at the end of
// the build process using prl_disk_tool utility (except for the case that
// disk_type is set to plain). In certain rare cases, this might corrupt
// the resulting disk image. If you find this to be the case, you can disable
// compaction using this configuration value.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// the build process using prl_disk_tool utility (except for the case that
// disk_type is set to plain). In certain rare cases, this might corrupt
// the resulting disk image. If you find this to be the case, you can disable
// compaction using this configuration value.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// This is the name of the PVM directory for the new
// virtual machine, without the file extension. By default this is
// "packer-BUILDNAME", where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// virtual machine, without the file extension. By default this is
// "packer-BUILDNAME", where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// If this is "false" the MAC address of the first
// NIC will reused when imported else a new MAC address will be generated
// by Parallels. Defaults to "false".
ReassignMAC bool `mapstructure:"reassign_mac" required:"false"`
// NIC will reused when imported else a new MAC address will be generated
// by Parallels. Defaults to "false".
ReassignMAC bool `mapstructure:"reassign_mac" required:"false"`
ctx interpolate.Context
}

View File

@ -98,133 +98,133 @@ type Config struct {
Comm communicator.Config `mapstructure:",squash"`
common.FloppyConfig `mapstructure:",squash"`
// Use iso from provided url. Qemu must support
// curl block device. This defaults to false.
ISOSkipCache bool `mapstructure:"iso_skip_cache" required:"false"`
// curl block device. This defaults to false.
ISOSkipCache bool `mapstructure:"iso_skip_cache" required:"false"`
// The accelerator type to use when running the VM.
// This may be none, kvm, tcg, hax, hvf, whpx, or xen. The appropriate
// software must have already been installed on your build machine to use the
// accelerator you specified. When no accelerator is specified, Packer will try
// to use kvm if it is available but will default to tcg otherwise.
Accelerator string `mapstructure:"accelerator" required:"false"`
// This may be none, kvm, tcg, hax, hvf, whpx, or xen. The appropriate
// software must have already been installed on your build machine to use the
// accelerator you specified. When no accelerator is specified, Packer will try
// to use kvm if it is available but will default to tcg otherwise.
Accelerator string `mapstructure:"accelerator" required:"false"`
// The number of cpus to use when building the VM.
// The default is 1 CPU.
CpuCount int `mapstructure:"cpus" required:"false"`
// The default is 1 CPU.
CpuCount int `mapstructure:"cpus" required:"false"`
// The interface to use for the disk. Allowed
// values include any of ide, scsi, virtio or virtio-scsi*. Note
// also that any boot commands or kickstart type scripts must have proper
// adjustments for resulting device names. The Qemu builder uses virtio by
// default.
DiskInterface string `mapstructure:"disk_interface" required:"false"`
// values include any of ide, scsi, virtio or virtio-scsi*. Note
// also that any boot commands or kickstart type scripts must have proper
// adjustments for resulting device names. The Qemu builder uses virtio by
// default.
DiskInterface string `mapstructure:"disk_interface" required:"false"`
// The size, in megabytes, of the hard disk to create
// for the VM. By default, this is 40960 (40 GB).
DiskSize uint `mapstructure:"disk_size" required:"false"`
// for the VM. By default, this is 40960 (40 GB).
DiskSize uint `mapstructure:"disk_size" required:"false"`
// The cache mode to use for disk. Allowed values
// include any of writethrough, writeback, none, unsafe
// or directsync. By default, this is set to writeback.
DiskCache string `mapstructure:"disk_cache" required:"false"`
// include any of writethrough, writeback, none, unsafe
// or directsync. By default, this is set to writeback.
DiskCache string `mapstructure:"disk_cache" required:"false"`
// The discard mode to use for disk. Allowed values
// include any of unmap or ignore. By default, this is set to ignore.
DiskDiscard string `mapstructure:"disk_discard" required:"false"`
// include any of unmap or ignore. By default, this is set to ignore.
DiskDiscard string `mapstructure:"disk_discard" required:"false"`
// The detect-zeroes mode to use for disk.
// Allowed values include any of unmap, on or off. Defaults to off.
// When the value is "off" we don't set the flag in the qemu command, so that
// Packer still works with old versions of QEMU that don't have this option.
DetectZeroes string `mapstructure:"disk_detect_zeroes" required:"false"`
// Allowed values include any of unmap, on or off. Defaults to off.
// When the value is "off" we don't set the flag in the qemu command, so that
// Packer still works with old versions of QEMU that don't have this option.
DetectZeroes string `mapstructure:"disk_detect_zeroes" required:"false"`
// Packer compacts the QCOW2 image using
// qemu-img convert. Set this option to true to disable compacting.
// Defaults to false.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// qemu-img convert. Set this option to true to disable compacting.
// Defaults to false.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// Apply compression to the QCOW2 disk file
// using qemu-img convert. Defaults to false.
DiskCompression bool `mapstructure:"disk_compression" required:"false"`
// using qemu-img convert. Defaults to false.
DiskCompression bool `mapstructure:"disk_compression" required:"false"`
// Either qcow2 or raw, this specifies the output
// format of the virtual machine image. This defaults to qcow2.
Format string `mapstructure:"format" required:"false"`
// format of the virtual machine image. This defaults to qcow2.
Format string `mapstructure:"format" required:"false"`
// Packer defaults to building QEMU virtual machines by
// launching a GUI that shows the console of the machine being built. When this
// value is set to true, the machine will start without a console.
Headless bool `mapstructure:"headless" required:"false"`
// launching a GUI that shows the console of the machine being built. When this
// value is set to true, the machine will start without a console.
Headless bool `mapstructure:"headless" required:"false"`
// Packer defaults to building from an ISO file, this
// parameter controls whether the ISO URL supplied is actually a bootable
// QEMU image. When this value is set to true, the machine will either clone
// the source or use it as a backing file (if use_backing_file is true);
// then, it will resize the image according to disk_size and boot it.
DiskImage bool `mapstructure:"disk_image" required:"false"`
// parameter controls whether the ISO URL supplied is actually a bootable
// QEMU image. When this value is set to true, the machine will either clone
// the source or use it as a backing file (if use_backing_file is true);
// then, it will resize the image according to disk_size and boot it.
DiskImage bool `mapstructure:"disk_image" required:"false"`
// Only applicable when disk_image is true
// and format is qcow2, set this option to true to create a new QCOW2
// file that uses the file located at iso_url as a backing file. The new file
// will only contain blocks that have changed compared to the backing file, so
// enabling this option can significantly reduce disk usage.
UseBackingFile bool `mapstructure:"use_backing_file" required:"false"`
// and format is qcow2, set this option to true to create a new QCOW2
// file that uses the file located at iso_url as a backing file. The new file
// will only contain blocks that have changed compared to the backing file, so
// enabling this option can significantly reduce disk usage.
UseBackingFile bool `mapstructure:"use_backing_file" required:"false"`
// The type of machine emulation to use. Run your
// qemu binary with the flags -machine help to list available types for
// your system. This defaults to pc.
MachineType string `mapstructure:"machine_type" required:"false"`
// qemu binary with the flags -machine help to list available types for
// your system. This defaults to pc.
MachineType string `mapstructure:"machine_type" required:"false"`
// The amount of memory to use when building the VM
// in megabytes. This defaults to 512 megabytes.
MemorySize int `mapstructure:"memory" required:"false"`
// in megabytes. This defaults to 512 megabytes.
MemorySize int `mapstructure:"memory" required:"false"`
// The driver to use for the network interface. Allowed
// values ne2k_pci, i82551, i82557b, i82559er, rtl8139, e1000,
// pcnet, virtio, virtio-net, virtio-net-pci, usb-net, i82559a,
// i82559b, i82559c, i82550, i82562, i82557a, i82557c, i82801,
// vmxnet3, i82558a or i82558b. The Qemu builder uses virtio-net by
// default.
NetDevice string `mapstructure:"net_device" required:"false"`
// values ne2k_pci, i82551, i82557b, i82559er, rtl8139, e1000,
// pcnet, virtio, virtio-net, virtio-net-pci, usb-net, i82559a,
// i82559b, i82559c, i82550, i82562, i82557a, i82557c, i82801,
// vmxnet3, i82558a or i82558b. The Qemu builder uses virtio-net by
// default.
NetDevice string `mapstructure:"net_device" required:"false"`
// This is the path to the directory where the
// resulting virtual machine will be created. This may be relative or absolute.
// If relative, the path is relative to the working directory when packer
// is executed. This directory must not exist or be empty prior to running
// the builder. By default this is output-BUILDNAME where "BUILDNAME" is the
// name of the build.
OutputDir string `mapstructure:"output_directory" required:"false"`
// resulting virtual machine will be created. This may be relative or absolute.
// If relative, the path is relative to the working directory when packer
// is executed. This directory must not exist or be empty prior to running
// the builder. By default this is output-BUILDNAME where "BUILDNAME" is the
// name of the build.
OutputDir string `mapstructure:"output_directory" required:"false"`
// Allows complete control over the
// qemu command line (though not, at this time, qemu-img). Each array of
// strings makes up a command line switch that overrides matching default
// switch/value pairs. Any value specified as an empty string is ignored. All
// values after the switch are concatenated with no separator.
QemuArgs [][]string `mapstructure:"qemuargs" required:"false"`
// qemu command line (though not, at this time, qemu-img). Each array of
// strings makes up a command line switch that overrides matching default
// switch/value pairs. Any value specified as an empty string is ignored. All
// values after the switch are concatenated with no separator.
QemuArgs [][]string `mapstructure:"qemuargs" required:"false"`
// The name of the Qemu binary to look for. This
// defaults to qemu-system-x86_64, but may need to be changed for
// some platforms. For example qemu-kvm, or qemu-system-i386 may be a
// better choice for some systems.
QemuBinary string `mapstructure:"qemu_binary" required:"false"`
// defaults to qemu-system-x86_64, but may need to be changed for
// some platforms. For example qemu-kvm, or qemu-system-i386 may be a
// better choice for some systems.
QemuBinary string `mapstructure:"qemu_binary" required:"false"`
// The command to use to gracefully shut down the
// machine once all the provisioning is done. By default this is an empty
// string, which tells Packer to just forcefully shut down the machine unless a
// shutdown command takes place inside script so this may safely be omitted. It
// is important to add a shutdown_command. By default Packer halts the virtual
// machine and the file system may not be sync'd. Thus, changes made in a
// provisioner might not be saved. If one or more scripts require a reboot it is
// suggested to leave this blank since reboots may fail and specify the final
// shutdown command in your last script.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// machine once all the provisioning is done. By default this is an empty
// string, which tells Packer to just forcefully shut down the machine unless a
// shutdown command takes place inside script so this may safely be omitted. It
// is important to add a shutdown_command. By default Packer halts the virtual
// machine and the file system may not be sync'd. Thus, changes made in a
// provisioner might not be saved. If one or more scripts require a reboot it is
// suggested to leave this blank since reboots may fail and specify the final
// shutdown command in your last script.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// The minimum and
// maximum port to use for the SSH port on the host machine which is forwarded
// to the SSH port on the guest machine. Because Packer often runs in parallel,
// Packer will choose a randomly available port in this range to use as the
// host port. By default this is 2222 to 4444.
SSHHostPortMin int `mapstructure:"ssh_host_port_min" required:"false"`
SSHHostPortMax int `mapstructure:"ssh_host_port_max"`
// maximum port to use for the SSH port on the host machine which is forwarded
// to the SSH port on the guest machine. Because Packer often runs in parallel,
// Packer will choose a randomly available port in this range to use as the
// host port. By default this is 2222 to 4444.
SSHHostPortMin int `mapstructure:"ssh_host_port_min" required:"false"`
SSHHostPortMax int `mapstructure:"ssh_host_port_max"`
// If true, do not pass a -display option
// to qemu, allowing it to choose the default. This may be needed when running
// under macOS, and getting errors about sdl not being available.
UseDefaultDisplay bool `mapstructure:"use_default_display" required:"false"`
// to qemu, allowing it to choose the default. This may be needed when running
// under macOS, and getting errors about sdl not being available.
UseDefaultDisplay bool `mapstructure:"use_default_display" required:"false"`
// The IP address that should be
// binded to for VNC. By default packer will use 127.0.0.1 for this. If you
// wish to bind to all interfaces use 0.0.0.0.
VNCBindAddress string `mapstructure:"vnc_bind_address" required:"false"`
// binded to for VNC. By default packer will use 127.0.0.1 for this. If you
// wish to bind to all interfaces use 0.0.0.0.
VNCBindAddress string `mapstructure:"vnc_bind_address" required:"false"`
// The minimum and maximum port
// to use for VNC access to the virtual machine. The builder uses VNC to type
// the initial boot_command. Because Packer generally runs in parallel,
// Packer uses a randomly chosen port in this range that appears available. By
// default this is 5900 to 6000. The minimum and maximum ports are inclusive.
VNCPortMin int `mapstructure:"vnc_port_min" required:"false"`
VNCPortMax int `mapstructure:"vnc_port_max"`
// to use for VNC access to the virtual machine. The builder uses VNC to type
// the initial boot_command. Because Packer generally runs in parallel,
// Packer uses a randomly chosen port in this range that appears available. By
// default this is 5900 to 6000. The minimum and maximum ports are inclusive.
VNCPortMin int `mapstructure:"vnc_port_min" required:"false"`
VNCPortMax int `mapstructure:"vnc_port_max"`
// This is the name of the image (QCOW2 or IMG) file for
// the new virtual machine. By default this is packer-BUILDNAME, where
// "BUILDNAME" is the name of the build. Currently, no file extension will be
// used unless it is specified in this option.
VMName string `mapstructure:"vm_name" required:"false"`
// the new virtual machine. By default this is packer-BUILDNAME, where
// "BUILDNAME" is the name of the build. Currently, no file extension will be
// used unless it is specified in this option.
VMName string `mapstructure:"vm_name" required:"false"`
// These are deprecated, but we keep them around for BC
// TODO(@mitchellh): remove
@ -233,9 +233,9 @@ type Config struct {
// TODO(mitchellh): deprecate
RunOnce bool `mapstructure:"run_once"`
// The amount of time to wait after executing the
// shutdown_command for the virtual machine to actually shut down. If it
// doesn't shut down in this time, it is an error. By default, the timeout is
// 5m or five minutes.
// shutdown_command for the virtual machine to actually shut down. If it
// doesn't shut down in this time, it is an error. By default, the timeout is
// 5m or five minutes.
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
shutdownTimeout time.Duration ``

View File

@ -22,47 +22,47 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
// The token to use to authenticate with your account.
// It can also be specified via environment variable SCALEWAY_API_TOKEN. You
// can see and generate tokens in the "Credentials"
// section of the control panel.
Token string `mapstructure:"api_token" required:"true"`
// It can also be specified via environment variable SCALEWAY_API_TOKEN. You
// can see and generate tokens in the "Credentials"
// section of the control panel.
Token string `mapstructure:"api_token" required:"true"`
// The organization id to use to identify your
// organization. It can also be specified via environment variable
// SCALEWAY_ORGANIZATION. Your organization id is available in the
// "Account" section of the
// control panel.
// Previously named: api_access_key with environment variable: SCALEWAY_API_ACCESS_KEY
// organization. It can also be specified via environment variable
// SCALEWAY_ORGANIZATION. Your organization id is available in the
// "Account" section of the
// control panel.
// Previously named: api_access_key with environment variable: SCALEWAY_API_ACCESS_KEY
Organization string `mapstructure:"organization_id" required:"true"`
// The name of the region to launch the server in (par1
// or ams1). Consequently, this is the region where the snapshot will be
// available.
Region string `mapstructure:"region" required:"true"`
// or ams1). Consequently, this is the region where the snapshot will be
// available.
Region string `mapstructure:"region" required:"true"`
// The UUID of the base image to use. This is the image
// that will be used to launch a new server and provision it. See
// the images list
// get the complete list of the accepted image UUID.
Image string `mapstructure:"image" required:"true"`
// that will be used to launch a new server and provision it. See
// the images list
// get the complete list of the accepted image UUID.
Image string `mapstructure:"image" required:"true"`
// The name of the server commercial type:
// ARM64-128GB, ARM64-16GB, ARM64-2GB, ARM64-32GB, ARM64-4GB,
// ARM64-64GB, ARM64-8GB, C1, C2L, C2M, C2S, START1-L,
// START1-M, START1-S, START1-XS, X64-120GB, X64-15GB, X64-30GB,
// X64-60GB
// ARM64-128GB, ARM64-16GB, ARM64-2GB, ARM64-32GB, ARM64-4GB,
// ARM64-64GB, ARM64-8GB, C1, C2L, C2M, C2S, START1-L,
// START1-M, START1-S, START1-XS, X64-120GB, X64-15GB, X64-30GB,
// X64-60GB
CommercialType string `mapstructure:"commercial_type" required:"true"`
// The name of the resulting snapshot that will
// appear in your account. Default packer-TIMESTAMP
// appear in your account. Default packer-TIMESTAMP
SnapshotName string `mapstructure:"snapshot_name" required:"false"`
// The name of the resulting image that will appear in
// your account. Default packer-TIMESTAMP
ImageName string `mapstructure:"image_name" required:"false"`
// your account. Default packer-TIMESTAMP
ImageName string `mapstructure:"image_name" required:"false"`
// The name assigned to the server. Default
// packer-UUID
ServerName string `mapstructure:"server_name" required:"false"`
// packer-UUID
ServerName string `mapstructure:"server_name" required:"false"`
// The id of an existing bootscript to use when
// booting the server.
Bootscript string `mapstructure:"bootscript" required:"false"`
// booting the server.
Bootscript string `mapstructure:"bootscript" required:"false"`
// The type of boot, can be either local or
// bootscript, Default bootscript
BootType string `mapstructure:"boottype" required:"false"`
// bootscript, Default bootscript
BootType string `mapstructure:"boottype" required:"false"`
UserAgent string
ctx interpolate.Context

View File

@ -47,21 +47,21 @@ var ValidRegions = []Region{
type TencentCloudAccessConfig struct {
// Tencentcloud secret id. You should set it directly,
// or set the TENCENTCLOUD_ACCESS_KEY environment variable.
SecretId string `mapstructure:"secret_id" required:"true"`
// or set the TENCENTCLOUD_ACCESS_KEY environment variable.
SecretId string `mapstructure:"secret_id" required:"true"`
// Tencentcloud secret key. You should set it directly,
// or set the TENCENTCLOUD_SECRET_KEY environment variable.
SecretKey string `mapstructure:"secret_key" required:"true"`
// or set the TENCENTCLOUD_SECRET_KEY environment variable.
SecretKey string `mapstructure:"secret_key" required:"true"`
// The region where your cvm will be launch. You should
// reference Region and Zone
// for parameter taking.
Region string `mapstructure:"region" required:"true"`
// reference Region and Zone
// for parameter taking.
Region string `mapstructure:"region" required:"true"`
// The zone where your cvm will be launch. You should
// reference Region and Zone
// for parameter taking.
Zone string `mapstructure:"zone" required:"true"`
// reference Region and Zone
// for parameter taking.
Zone string `mapstructure:"zone" required:"true"`
// Do not check region and zone when validate.
SkipValidation bool `mapstructure:"skip_region_validation" required:"false"`
SkipValidation bool `mapstructure:"skip_region_validation" required:"false"`
}
func (cf *TencentCloudAccessConfig) Client() (*cvm.Client, *vpc.Client, error) {

View File

@ -11,28 +11,28 @@ import (
type TencentCloudImageConfig struct {
// The name you want to create your customize image,
// it should be composed of no more than 20 characters, of letters, numbers
// or minus sign.
ImageName string `mapstructure:"image_name" required:"true"`
// it should be composed of no more than 20 characters, of letters, numbers
// or minus sign.
ImageName string `mapstructure:"image_name" required:"true"`
// Image description.
ImageDescription string `mapstructure:"image_description" required:"false"`
ImageDescription string `mapstructure:"image_description" required:"false"`
// Whether shutdown cvm to create Image. Default value is
// false.
Reboot bool `mapstructure:"reboot" required:"false"`
// false.
Reboot bool `mapstructure:"reboot" required:"false"`
// Whether to force power off cvm when create image.
// Default value is false.
ForcePoweroff bool `mapstructure:"force_poweroff" required:"false"`
// Default value is false.
ForcePoweroff bool `mapstructure:"force_poweroff" required:"false"`
// Whether enable Sysprep during creating windows image.
Sysprep bool `mapstructure:"sysprep" required:"false"`
ImageForceDelete bool `mapstructure:"image_force_delete"`
Sysprep bool `mapstructure:"sysprep" required:"false"`
ImageForceDelete bool `mapstructure:"image_force_delete"`
// regions that will be copied to after
// your image created.
ImageCopyRegions []string `mapstructure:"image_copy_regions" required:"false"`
// your image created.
ImageCopyRegions []string `mapstructure:"image_copy_regions" required:"false"`
// accounts that will be shared to
// after your image created.
// after your image created.
ImageShareAccounts []string `mapstructure:"image_share_accounts" required:"false"`
// Do not check region and zone when validate.
SkipValidation bool `mapstructure:"skip_region_validation" required:"false"`
SkipValidation bool `mapstructure:"skip_region_validation" required:"false"`
}
func (cf *TencentCloudImageConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -14,53 +14,53 @@ import (
type TencentCloudRunConfig struct {
// Whether allocate public ip to your cvm.
// Default value is false.
AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address" required:"false"`
// Default value is false.
AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address" required:"false"`
// The base image id of Image you want to create
// your customized image from.
SourceImageId string `mapstructure:"source_image_id" required:"true"`
// your customized image from.
SourceImageId string `mapstructure:"source_image_id" required:"true"`
// The instance type your cvm will be launched by.
// You should reference Instace Type
// for parameter taking.
InstanceType string `mapstructure:"instance_type" required:"true"`
// You should reference Instace Type
// for parameter taking.
InstanceType string `mapstructure:"instance_type" required:"true"`
// Instance name.
InstanceName string `mapstructure:"instance_name" required:"false"`
InstanceName string `mapstructure:"instance_name" required:"false"`
// Root disk type your cvm will be launched by. you could
// reference Disk Type
// for parameter taking.
DiskType string `mapstructure:"disk_type" required:"false"`
// reference Disk Type
// for parameter taking.
DiskType string `mapstructure:"disk_type" required:"false"`
// Root disk size your cvm will be launched by. values range(in GB):
DiskSize int64 `mapstructure:"disk_size" required:"false"`
DiskSize int64 `mapstructure:"disk_size" required:"false"`
// Specify vpc your cvm will be launched by.
VpcId string `mapstructure:"vpc_id" required:"false"`
VpcId string `mapstructure:"vpc_id" required:"false"`
// Specify vpc name you will create. if vpc_id is not set, packer will
// create a vpc for you named this parameter.
VpcName string `mapstructure:"vpc_name" required:"false"`
VpcIp string `mapstructure:"vpc_ip"`
// create a vpc for you named this parameter.
VpcName string `mapstructure:"vpc_name" required:"false"`
VpcIp string `mapstructure:"vpc_ip"`
// Specify subnet your cvm will be launched by.
SubnetId string `mapstructure:"subnet_id" required:"false"`
SubnetId string `mapstructure:"subnet_id" required:"false"`
// Specify subnet name you will create. if subnet_id is not set, packer will
// create a subnet for you named this parameter.
SubnetName string `mapstructure:"subnet_name" required:"false"`
// create a subnet for you named this parameter.
SubnetName string `mapstructure:"subnet_name" required:"false"`
// Specify cider block of the vpc you will create if vpc_id not set
CidrBlock string `mapstructure:"cidr_block" required:"false"` // 10.0.0.0/16(default), 172.16.0.0/12, 192.168.0.0/16
CidrBlock string `mapstructure:"cidr_block" required:"false"` // 10.0.0.0/16(default), 172.16.0.0/12, 192.168.0.0/16
// Specify cider block of the subnet you will create if
// subnet_id not set
SubnectCidrBlock string `mapstructure:"subnect_cidr_block" required:"false"`
InternetChargeType string `mapstructure:"internet_charge_type"`
// subnet_id not set
SubnectCidrBlock string `mapstructure:"subnect_cidr_block" required:"false"`
InternetChargeType string `mapstructure:"internet_charge_type"`
// Max bandwidth out your cvm will be launched by(in MB).
// values can be set between 1 ~ 100.
InternetMaxBandwidthOut int64 `mapstructure:"internet_max_bandwidth_out" required:"false"`
// values can be set between 1 ~ 100.
InternetMaxBandwidthOut int64 `mapstructure:"internet_max_bandwidth_out" required:"false"`
// Specify security group your cvm will be launched by.
SecurityGroupId string `mapstructure:"security_group_id" required:"false"`
SecurityGroupId string `mapstructure:"security_group_id" required:"false"`
// Specify security name you will create if security_group_id not set.
SecurityGroupName string `mapstructure:"security_group_name" required:"false"`
SecurityGroupName string `mapstructure:"security_group_name" required:"false"`
// userdata.
UserData string `mapstructure:"user_data" required:"false"`
UserData string `mapstructure:"user_data" required:"false"`
// userdata file.
UserDataFile string `mapstructure:"user_data_file" required:"false"`
UserDataFile string `mapstructure:"user_data_file" required:"false"`
// host name.
HostName string `mapstructure:"host_name" required:"false"`
HostName string `mapstructure:"host_name" required:"false"`
// Communicator settings
Comm communicator.Config `mapstructure:",squash"`

View File

@ -20,31 +20,31 @@ import (
// AccessConfig is for common configuration related to Triton access
type AccessConfig struct {
// The URL of the Triton cloud API to use. If omitted
// it will default to the us-sw-1 region of the Joyent Public cloud. If you
// are using your own private Triton installation you will have to supply the
// URL of the cloud API of your own Triton installation.
Endpoint string `mapstructure:"triton_url" required:"false"`
// it will default to the us-sw-1 region of the Joyent Public cloud. If you
// are using your own private Triton installation you will have to supply the
// URL of the cloud API of your own Triton installation.
Endpoint string `mapstructure:"triton_url" required:"false"`
// The username of the Triton account to use when
// using the Triton Cloud API.
Account string `mapstructure:"triton_account" required:"true"`
// using the Triton Cloud API.
Account string `mapstructure:"triton_account" required:"true"`
// The username of a user who has access to your
// Triton account.
Username string `mapstructure:"triton_user" required:"false"`
// Triton account.
Username string `mapstructure:"triton_user" required:"false"`
// The fingerprint of the public key of the SSH key
// pair to use for authentication with the Triton Cloud API. If
// triton_key_material is not set, it is assumed that the SSH agent has the
// private key corresponding to this key ID loaded.
KeyID string `mapstructure:"triton_key_id" required:"true"`
// pair to use for authentication with the Triton Cloud API. If
// triton_key_material is not set, it is assumed that the SSH agent has the
// private key corresponding to this key ID loaded.
KeyID string `mapstructure:"triton_key_id" required:"true"`
// Path to the file in which the private key
// of triton_key_id is stored. For example /home/soandso/.ssh/id_rsa. If
// this is not specified, the SSH agent is used to sign requests with the
// triton_key_id specified.
KeyMaterial string `mapstructure:"triton_key_material" required:"false"`
// of triton_key_id is stored. For example /home/soandso/.ssh/id_rsa. If
// this is not specified, the SSH agent is used to sign requests with the
// triton_key_id specified.
KeyMaterial string `mapstructure:"triton_key_material" required:"false"`
//secure_skip_tls_verify - (bool) This allows skipping TLS verification
// of the Triton endpoint. It is useful when connecting to a temporary Triton
// installation such as Cloud-On-A-Laptop which does not generally use a
// certificate signed by a trusted root CA. The default is false.
InsecureSkipTLSVerify bool `mapstructure:"insecure_skip_tls_verify" required:"false"`
// of the Triton endpoint. It is useful when connecting to a temporary Triton
// installation such as Cloud-On-A-Laptop which does not generally use a
// certificate signed by a trusted root CA. The default is false.
InsecureSkipTLSVerify bool `mapstructure:"insecure_skip_tls_verify" required:"false"`
signer authentication.Signer
}

View File

@ -12,59 +12,59 @@ import (
// the SDC API in order for provisioning to take place.
type SourceMachineConfig struct {
// Name of the VM used for building the
// image. Does not affect (and does not have to be the same) as the name for a
// VM instance running this image. Maximum 512 characters but should in
// practice be much shorter (think between 5 and 20 characters). For example
// mysql-64-server-image-builder. When omitted defaults to
// packer-builder-[image_name].
MachineName string `mapstructure:"source_machine_name" required:"false"`
// image. Does not affect (and does not have to be the same) as the name for a
// VM instance running this image. Maximum 512 characters but should in
// practice be much shorter (think between 5 and 20 characters). For example
// mysql-64-server-image-builder. When omitted defaults to
// packer-builder-[image_name].
MachineName string `mapstructure:"source_machine_name" required:"false"`
// The Triton package to use while
// building the image. Does not affect (and does not have to be the same) as
// the package which will be used for a VM instance running this image. On the
// Joyent public cloud this could for example be g3-standard-0.5-smartos.
MachinePackage string `mapstructure:"source_machine_package" required:"true"`
// building the image. Does not affect (and does not have to be the same) as
// the package which will be used for a VM instance running this image. On the
// Joyent public cloud this could for example be g3-standard-0.5-smartos.
MachinePackage string `mapstructure:"source_machine_package" required:"true"`
// The UUID of the image to base the new
// image on. Triton supports multiple types of images, called 'brands' in
// Triton / Joyent lingo, for contains and VM's. See the chapter Containers
// and virtual machines in
// the Joyent Triton documentation for detailed information. The following
// brands are currently supported by this builder:joyent andkvm. The
// choice of base image automatically decides the brand. On the Joyent public
// cloud a valid source_machine_image could for example be
// 70e3ae72-96b6-11e6-9056-9737fd4d0764 for version 16.3.1 of the 64bit
// SmartOS base image (a 'joyent' brand image). source_machine_image_filter
// can be used to populate this UUID.
MachineImage string `mapstructure:"source_machine_image" required:"true"`
// image on. Triton supports multiple types of images, called 'brands' in
// Triton / Joyent lingo, for contains and VM's. See the chapter Containers
// and virtual machines in
// the Joyent Triton documentation for detailed information. The following
// brands are currently supported by this builder:joyent andkvm. The
// choice of base image automatically decides the brand. On the Joyent public
// cloud a valid source_machine_image could for example be
// 70e3ae72-96b6-11e6-9056-9737fd4d0764 for version 16.3.1 of the 64bit
// SmartOS base image (a 'joyent' brand image). source_machine_image_filter
// can be used to populate this UUID.
MachineImage string `mapstructure:"source_machine_image" required:"true"`
// The UUID's of Triton
// networks added to the source machine used for creating the image. For
// example if any of the provisioners which are run need Internet access you
// will need to add the UUID's of the appropriate networks here. If this is
// not specified, instances will be placed into the default Triton public and
// internal networks.
MachineNetworks []string `mapstructure:"source_machine_networks" required:"false"`
// networks added to the source machine used for creating the image. For
// example if any of the provisioners which are run need Internet access you
// will need to add the UUID's of the appropriate networks here. If this is
// not specified, instances will be placed into the default Triton public and
// internal networks.
MachineNetworks []string `mapstructure:"source_machine_networks" required:"false"`
// Triton metadata
// applied to the VM used to create the image. Metadata can be used to pass
// configuration information to the VM without the need for networking. See
// Using the metadata
// API in the
// Joyent documentation for more information. This can for example be used to
// set the user-script metadata key to have Triton start a user supplied
// script after the VM has booted.
MachineMetadata map[string]string `mapstructure:"source_machine_metadata" required:"false"`
// applied to the VM used to create the image. Metadata can be used to pass
// configuration information to the VM without the need for networking. See
// Using the metadata
// API in the
// Joyent documentation for more information. This can for example be used to
// set the user-script metadata key to have Triton start a user supplied
// script after the VM has booted.
MachineMetadata map[string]string `mapstructure:"source_machine_metadata" required:"false"`
// Tags applied to the
// VM used to create the image.
MachineTags map[string]string `mapstructure:"source_machine_tags" required:"false"`
// VM used to create the image.
MachineTags map[string]string `mapstructure:"source_machine_tags" required:"false"`
// Whether or not the firewall
// of the VM used to create an image of is enabled. The Triton firewall only
// filters inbound traffic to the VM. All outbound traffic is always allowed.
// Currently this builder does not provide an interface to add specific
// firewall rules. Unless you have a global rule defined in Triton which
// allows SSH traffic enabling the firewall will interfere with the SSH
// provisioner. The default is false.
MachineFirewallEnabled bool `mapstructure:"source_machine_firewall_enabled" required:"false"`
// of the VM used to create an image of is enabled. The Triton firewall only
// filters inbound traffic to the VM. All outbound traffic is always allowed.
// Currently this builder does not provide an interface to add specific
// firewall rules. Unless you have a global rule defined in Triton which
// allows SSH traffic enabling the firewall will interfere with the SSH
// provisioner. The default is false.
MachineFirewallEnabled bool `mapstructure:"source_machine_firewall_enabled" required:"false"`
// Filters used to populate the
// source_machine_image field. Example:
MachineImageFilters MachineImageFilter `mapstructure:"source_machine_image_filter" required:"false"`
// source_machine_image field. Example:
MachineImageFilters MachineImageFilter `mapstructure:"source_machine_image_filter" required:"false"`
}
type MachineImageFilter struct {

View File

@ -12,30 +12,30 @@ import (
// from the source machine.
type TargetImageConfig struct {
// The name the finished image in Triton will be
// assigned. Maximum 512 characters but should in practice be much shorter
// (think between 5 and 20 characters). For example postgresql-95-server for
// an image used as a PostgreSQL 9.5 server.
ImageName string `mapstructure:"image_name" required:"true"`
// assigned. Maximum 512 characters but should in practice be much shorter
// (think between 5 and 20 characters). For example postgresql-95-server for
// an image used as a PostgreSQL 9.5 server.
ImageName string `mapstructure:"image_name" required:"true"`
// The version string for this image. Maximum 128
// characters. Any string will do but a format of Major.Minor.Patch is
// strongly advised by Joyent. See Semantic Versioning
// for more information on the Major.Minor.Patch versioning format.
ImageVersion string `mapstructure:"image_version" required:"true"`
// characters. Any string will do but a format of Major.Minor.Patch is
// strongly advised by Joyent. See Semantic Versioning
// for more information on the Major.Minor.Patch versioning format.
ImageVersion string `mapstructure:"image_version" required:"true"`
// Description of the image. Maximum 512
// characters.
ImageDescription string `mapstructure:"image_description" required:"false"`
// characters.
ImageDescription string `mapstructure:"image_description" required:"false"`
// URL of the homepage where users can find
// information about the image. Maximum 128 characters.
ImageHomepage string `mapstructure:"image_homepage" required:"false"`
// information about the image. Maximum 128 characters.
ImageHomepage string `mapstructure:"image_homepage" required:"false"`
// URL of the End User License Agreement (EULA)
// for the image. Maximum 128 characters.
ImageEULA string `mapstructure:"image_eula_url" required:"false"`
// for the image. Maximum 128 characters.
ImageEULA string `mapstructure:"image_eula_url" required:"false"`
// The UUID's of the users which will have
// access to this image. When omitted only the owner (the Triton user whose
// credentials are used) will have access to the image.
ImageACL []string `mapstructure:"image_acls" required:"false"`
// access to this image. When omitted only the owner (the Triton user whose
// credentials are used) will have access to the image.
ImageACL []string `mapstructure:"image_acls" required:"false"`
// Tag applied to the image.
ImageTags map[string]string `mapstructure:"image_tags" required:"false"`
ImageTags map[string]string `mapstructure:"image_tags" required:"false"`
}
// Prepare performs basic validation on a TargetImageConfig struct.

View File

@ -10,7 +10,7 @@ import (
type ExportConfig struct {
// Either ovf or ova, this specifies the output format
// of the exported virtual machine. This defaults to ovf.
// of the exported virtual machine. This defaults to ovf.
Format string `mapstructure:"format" required:"false"`
}

View File

@ -8,10 +8,10 @@ import (
type ExportOpts struct {
// Additional options to pass to the
// VBoxManage
// export. This
// can be useful for passing product information to include in the resulting
// appliance file. Packer JSON configuration file example:
// VBoxManage
// export. This
// can be useful for passing product information to include in the resulting
// appliance file. Packer JSON configuration file example:
ExportOpts []string `mapstructure:"export_opts" required:"false"`
}

View File

@ -17,14 +17,14 @@ const (
)
type GuestAdditionsConfig struct {
Communicator string `mapstructure:"communicator"`
Communicator string `mapstructure:"communicator"`
// The method by which guest additions are
// made available to the guest for installation. Valid options are upload,
// attach, or disable. If the mode is attach the guest additions ISO will
// be attached as a CD device to the virtual machine. If the mode is upload
// the guest additions ISO will be uploaded to the path specified by
// guest_additions_path. The default value is upload. If disable is used,
// guest additions won't be downloaded, either.
// made available to the guest for installation. Valid options are upload,
// attach, or disable. If the mode is attach the guest additions ISO will
// be attached as a CD device to the virtual machine. If the mode is upload
// the guest additions ISO will be uploaded to the path specified by
// guest_additions_path. The default value is upload. If disable is used,
// guest additions won't be downloaded, either.
GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"`
}

View File

@ -10,18 +10,18 @@ import (
type HWConfig struct {
// The number of cpus to use for building the VM.
// Defaults to 1.
CpuCount int `mapstructure:"cpus" required:"false"`
// Defaults to 1.
CpuCount int `mapstructure:"cpus" required:"false"`
// The amount of memory to use for building the VM
// in megabytes. Defaults to 512 megabytes.
// in megabytes. Defaults to 512 megabytes.
MemorySize int `mapstructure:"memory" required:"false"`
// Defaults to none. The type of audio device to use for
// sound when building the VM. Some of the options that are available are
// dsound, oss, alsa, pulse, coreaudio, null.
// sound when building the VM. Some of the options that are available are
// dsound, oss, alsa, pulse, coreaudio, null.
Sound string `mapstructure:"sound" required:"false"`
// Specifies whether or not to enable the USB bus when
// building the VM. Defaults to false.
USB bool `mapstructure:"usb" required:"false"`
// building the VM. Defaults to false.
USB bool `mapstructure:"usb" required:"false"`
}
func (c *HWConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -11,11 +11,11 @@ import (
type OutputConfig struct {
// This is the path to the directory where the
// resulting virtual machine will be created. This may be relative or absolute.
// If relative, the path is relative to the working directory when packer
// is executed. This directory must not exist or be empty prior to running
// the builder. By default this is output-BUILDNAME where "BUILDNAME" is the
// name of the build.
// resulting virtual machine will be created. This may be relative or absolute.
// If relative, the path is relative to the working directory when packer
// is executed. This directory must not exist or be empty prior to running
// the builder. By default this is output-BUILDNAME where "BUILDNAME" is the
// name of the build.
OutputDir string `mapstructure:"output_directory" required:"false"`
}

View File

@ -10,20 +10,20 @@ import (
type RunConfig struct {
// Packer defaults to building VirtualBox virtual
// machines by launching a GUI that shows the console of the machine
// being built. When this value is set to true, the machine will start
// without a console.
// machines by launching a GUI that shows the console of the machine
// being built. When this value is set to true, the machine will start
// without a console.
Headless bool `mapstructure:"headless" required:"false"`
// The IP address that should be
// binded to for VRDP. By default packer will use 127.0.0.1 for this. If you
// wish to bind to all interfaces use 0.0.0.0.
// binded to for VRDP. By default packer will use 127.0.0.1 for this. If you
// wish to bind to all interfaces use 0.0.0.0.
VRDPBindAddress string `mapstructure:"vrdp_bind_address" required:"false"`
// The minimum and maximum port
// to use for VRDP access to the virtual machine. Packer uses a randomly chosen
// port in this range that appears available. By default this is 5900 to
// 6000. The minimum and maximum ports are inclusive.
VRDPPortMin int `mapstructure:"vrdp_port_min" required:"false"`
VRDPPortMax int `mapstructure:"vrdp_port_max"`
// to use for VRDP access to the virtual machine. Packer uses a randomly chosen
// port in this range that appears available. By default this is 5900 to
// 6000. The minimum and maximum ports are inclusive.
VRDPPortMin int `mapstructure:"vrdp_port_min" required:"false"`
VRDPPortMax int `mapstructure:"vrdp_port_max"`
}
func (c *RunConfig) Prepare(ctx *interpolate.Context) (errs []error) {

View File

@ -11,22 +11,22 @@ import (
type ShutdownConfig struct {
// The command to use to gracefully shut down the
// machine once all the provisioning is done. By default this is an empty
// string, which tells Packer to just forcefully shut down the machine unless a
// shutdown command takes place inside script so this may safely be omitted. If
// one or more scripts require a reboot it is suggested to leave this blank
// since reboots may fail and specify the final shutdown command in your
// last script.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// machine once all the provisioning is done. By default this is an empty
// string, which tells Packer to just forcefully shut down the machine unless a
// shutdown command takes place inside script so this may safely be omitted. If
// one or more scripts require a reboot it is suggested to leave this blank
// since reboots may fail and specify the final shutdown command in your
// last script.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// The amount of time to wait after executing the
// shutdown_command for the virtual machine to actually shut down. If it
// doesn't shut down in this time, it is an error. By default, the timeout is
// 5m or five minutes.
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
// shutdown_command for the virtual machine to actually shut down. If it
// doesn't shut down in this time, it is an error. By default, the timeout is
// 5m or five minutes.
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
// The amount of time to wait after shutting
// down the virtual machine. If you get the error
// Error removing floppy controller, you might need to set this to 5m
// or so. By default, the delay is 0s or disabled.
// down the virtual machine. If you get the error
// Error removing floppy controller, you might need to set this to 5m
// or so. By default, the delay is 0s or disabled.
RawPostShutdownDelay string `mapstructure:"post_shutdown_delay" required:"false"`
ShutdownTimeout time.Duration ``

View File

@ -13,15 +13,15 @@ import (
type SSHConfig struct {
Comm communicator.Config `mapstructure:",squash"`
// The minimum and
// maximum port to use for the SSH port on the host machine which is forwarded
// to the SSH port on the guest machine. Because Packer often runs in parallel,
// Packer will choose a randomly available port in this range to use as the
// host port. By default this is 2222 to 4444.
SSHHostPortMin int `mapstructure:"ssh_host_port_min" required:"false"`
SSHHostPortMax int `mapstructure:"ssh_host_port_max"`
// maximum port to use for the SSH port on the host machine which is forwarded
// to the SSH port on the guest machine. Because Packer often runs in parallel,
// Packer will choose a randomly available port in this range to use as the
// host port. By default this is 2222 to 4444.
SSHHostPortMin int `mapstructure:"ssh_host_port_min" required:"false"`
SSHHostPortMax int `mapstructure:"ssh_host_port_max"`
// Defaults to false. When enabled, Packer
// does not setup forwarded port mapping for SSH requests and uses ssh_port
// on the host to communicate to the virtual machine.
// does not setup forwarded port mapping for SSH requests and uses ssh_port
// on the host to communicate to the virtual machine.
SSHSkipNatMapping bool `mapstructure:"ssh_skip_nat_mapping" required:"false"`
// These are deprecated, but we keep them around for BC

View File

@ -9,13 +9,13 @@ import (
)
type VBoxVersionConfig struct {
Communicator string `mapstructure:"communicator"`
Communicator string `mapstructure:"communicator"`
// The path within the virtual machine to
// upload a file that contains the VirtualBox version that was used to create
// the machine. This information can be useful for provisioning. By default
// this is .vbox_version, which will generally be upload it into the
// home directory. Set to an empty string to skip uploading this file, which
// can be useful when using the none communicator.
// upload a file that contains the VirtualBox version that was used to create
// the machine. This information can be useful for provisioning. By default
// this is .vbox_version, which will generally be upload it into the
// home directory. Set to an empty string to skip uploading this file, which
// can be useful when using the none communicator.
VBoxVersionFile *string `mapstructure:"virtualbox_version_file" required:"false"`
}

View File

@ -8,9 +8,9 @@ import (
type VBoxBundleConfig struct {
// Defaults to false. When enabled, Packer includes
// any attached ISO disc devices into the final virtual machine. Useful for
// some live distributions that require installation media to continue to be
// attached after installation.
// any attached ISO disc devices into the final virtual machine. Useful for
// some live distributions that require installation media to continue to be
// attached after installation.
BundleISO bool `mapstructure:"bundle_iso" required:"false"`
}

View File

@ -8,15 +8,15 @@ import (
type VBoxManageConfig struct {
// Custom VBoxManage commands to
// execute in order to further customize the virtual machine being created. The
// value of this is an array of commands to execute. The commands are executed
// in the order defined in the template. For each command, the command is
// defined itself as an array of strings, where each string represents a single
// argument on the command-line to VBoxManage (but excluding
// VBoxManage itself). Each arg is treated as a configuration
// template, where the Name
// variable is replaced with the VM name. More details on how to use
// VBoxManage are below.
// execute in order to further customize the virtual machine being created. The
// value of this is an array of commands to execute. The commands are executed
// in the order defined in the template. For each command, the command is
// defined itself as an array of strings, where each string represents a single
// argument on the command-line to VBoxManage (but excluding
// VBoxManage itself). Each arg is treated as a configuration
// template, where the Name
// variable is replaced with the VM name. More details on how to use
// VBoxManage are below.
VBoxManage [][]string `mapstructure:"vboxmanage" required:"false"`
}

View File

@ -8,8 +8,8 @@ import (
type VBoxManagePostConfig struct {
// Identical to vboxmanage,
// except that it is run after the virtual machine is shutdown, and before the
// virtual machine is exported.
// except that it is run after the virtual machine is shutdown, and before the
// virtual machine is exported.
VBoxManagePost [][]string `mapstructure:"vboxmanage_post" required:"false"`
}

View File

@ -44,80 +44,80 @@ type Config struct {
vboxcommon.VBoxBundleConfig `mapstructure:",squash"`
vboxcommon.GuestAdditionsConfig `mapstructure:",squash"`
// The size, in megabytes, of the hard disk to create
// for the VM. By default, this is 40000 (about 40 GB).
DiskSize uint `mapstructure:"disk_size" required:"false"`
// for the VM. By default, this is 40000 (about 40 GB).
DiskSize uint `mapstructure:"disk_size" required:"false"`
// The method by which guest additions are
// made available to the guest for installation. Valid options are upload,
// attach, or disable. If the mode is attach the guest additions ISO will
// be attached as a CD device to the virtual machine. If the mode is upload
// the guest additions ISO will be uploaded to the path specified by
// guest_additions_path. The default value is upload. If disable is used,
// guest additions won't be downloaded, either.
GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"`
// made available to the guest for installation. Valid options are upload,
// attach, or disable. If the mode is attach the guest additions ISO will
// be attached as a CD device to the virtual machine. If the mode is upload
// the guest additions ISO will be uploaded to the path specified by
// guest_additions_path. The default value is upload. If disable is used,
// guest additions won't be downloaded, either.
GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"`
// The path on the guest virtual machine
// where the VirtualBox guest additions ISO will be uploaded. By default this
// is VBoxGuestAdditions.iso which should upload into the login directory of
// the user. This is a configuration
// template where the Version
// variable is replaced with the VirtualBox version.
GuestAdditionsPath string `mapstructure:"guest_additions_path" required:"false"`
// where the VirtualBox guest additions ISO will be uploaded. By default this
// is VBoxGuestAdditions.iso which should upload into the login directory of
// the user. This is a configuration
// template where the Version
// variable is replaced with the VirtualBox version.
GuestAdditionsPath string `mapstructure:"guest_additions_path" required:"false"`
// The SHA256 checksum of the guest
// additions ISO that will be uploaded to the guest VM. By default the
// checksums will be downloaded from the VirtualBox website, so this only needs
// to be set if you want to be explicit about the checksum.
GuestAdditionsSHA256 string `mapstructure:"guest_additions_sha256" required:"false"`
// additions ISO that will be uploaded to the guest VM. By default the
// checksums will be downloaded from the VirtualBox website, so this only needs
// to be set if you want to be explicit about the checksum.
GuestAdditionsSHA256 string `mapstructure:"guest_additions_sha256" required:"false"`
// The URL to the guest additions ISO
// to upload. This can also be a file URL if the ISO is at a local path. By
// default, the VirtualBox builder will attempt to find the guest additions ISO
// on the local file system. If it is not available locally, the builder will
// download the proper guest additions ISO from the internet.
GuestAdditionsURL string `mapstructure:"guest_additions_url" required:"false"`
// to upload. This can also be a file URL if the ISO is at a local path. By
// default, the VirtualBox builder will attempt to find the guest additions ISO
// on the local file system. If it is not available locally, the builder will
// download the proper guest additions ISO from the internet.
GuestAdditionsURL string `mapstructure:"guest_additions_url" required:"false"`
// The interface type to use to mount
// guest additions when guest_additions_mode is set to attach. Will
// default to the value set in iso_interface, if iso_interface is set.
// Will default to "ide", if iso_interface is not set. Options are "ide" and
// "sata".
// guest additions when guest_additions_mode is set to attach. Will
// default to the value set in iso_interface, if iso_interface is set.
// Will default to "ide", if iso_interface is not set. Options are "ide" and
// "sata".
GuestAdditionsInterface string `mapstructure:"guest_additions_interface" required:"false"`
// The guest OS type being installed. By default
// this is other, but you can get dramatic performance improvements by
// setting this to the proper value. To view all available values for this run
// VBoxManage list ostypes. Setting the correct value hints to VirtualBox how
// to optimize the virtual hardware to work best with that operating system.
GuestOSType string `mapstructure:"guest_os_type" required:"false"`
// this is other, but you can get dramatic performance improvements by
// setting this to the proper value. To view all available values for this run
// VBoxManage list ostypes. Setting the correct value hints to VirtualBox how
// to optimize the virtual hardware to work best with that operating system.
GuestOSType string `mapstructure:"guest_os_type" required:"false"`
// When this value is set to true, a VDI
// image will be shrunk in response to the trim command from the guest OS.
// The size of the cleared area must be at least 1MB. Also set
// hard_drive_nonrotational to true to enable TRIM support.
HardDriveDiscard bool `mapstructure:"hard_drive_discard" required:"false"`
// image will be shrunk in response to the trim command from the guest OS.
// The size of the cleared area must be at least 1MB. Also set
// hard_drive_nonrotational to true to enable TRIM support.
HardDriveDiscard bool `mapstructure:"hard_drive_discard" required:"false"`
// The type of controller that the primary
// hard drive is attached to, defaults to ide. When set to sata, the drive
// is attached to an AHCI SATA controller. When set to scsi, the drive is
// attached to an LsiLogic SCSI controller.
HardDriveInterface string `mapstructure:"hard_drive_interface" required:"false"`
// hard drive is attached to, defaults to ide. When set to sata, the drive
// is attached to an AHCI SATA controller. When set to scsi, the drive is
// attached to an LsiLogic SCSI controller.
HardDriveInterface string `mapstructure:"hard_drive_interface" required:"false"`
// The number of ports available on any SATA
// controller created, defaults to 1. VirtualBox supports up to 30 ports on a
// maximum of 1 SATA controller. Increasing this value can be useful if you
// want to attach additional drives.
SATAPortCount int `mapstructure:"sata_port_count" required:"false"`
// controller created, defaults to 1. VirtualBox supports up to 30 ports on a
// maximum of 1 SATA controller. Increasing this value can be useful if you
// want to attach additional drives.
SATAPortCount int `mapstructure:"sata_port_count" required:"false"`
// Forces some guests (i.e. Windows 7+)
// to treat disks as SSDs and stops them from performing disk fragmentation.
// Also set hard_drive_discard to true to enable TRIM support.
HardDriveNonrotational bool `mapstructure:"hard_drive_nonrotational" required:"false"`
// to treat disks as SSDs and stops them from performing disk fragmentation.
// Also set hard_drive_discard to true to enable TRIM support.
HardDriveNonrotational bool `mapstructure:"hard_drive_nonrotational" required:"false"`
// The type of controller that the ISO is attached
// to, defaults to ide. When set to sata, the drive is attached to an AHCI
// SATA controller.
ISOInterface string `mapstructure:"iso_interface" required:"false"`
// to, defaults to ide. When set to sata, the drive is attached to an AHCI
// SATA controller.
ISOInterface string `mapstructure:"iso_interface" required:"false"`
// Set this to true if you would like to keep
// the VM registered with virtualbox. Defaults to false.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
// the VM registered with virtualbox. Defaults to false.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
// Defaults to false. When enabled, Packer will
// not export the VM. Useful if the build output is not the resultant image,
// but created inside the VM.
SkipExport bool `mapstructure:"skip_export" required:"false"`
// not export the VM. Useful if the build output is not the resultant image,
// but created inside the VM.
SkipExport bool `mapstructure:"skip_export" required:"false"`
// This is the name of the OVF file for the new virtual
// machine, without the file extension. By default this is packer-BUILDNAME,
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// machine, without the file extension. By default this is packer-BUILDNAME,
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
ctx interpolate.Context
}

View File

@ -31,77 +31,77 @@ type Config struct {
vboxcommon.VBoxManagePostConfig `mapstructure:",squash"`
vboxcommon.VBoxVersionConfig `mapstructure:",squash"`
vboxcommon.GuestAdditionsConfig `mapstructure:",squash"`
// The checksum for the source_path file. The
// algorithm to use when computing the checksum can be optionally specified
// with checksum_type. When checksum_type is not set packer will guess the
// checksumming type based on checksum length. checksum can be also be a
// file or an URL, in which case checksum_type must be set to file; the
// go-getter will download it and use the first hash found.
Checksum string `mapstructure:"checksum" required:"true"`
// The checksum for the source_path file. The
// algorithm to use when computing the checksum can be optionally specified
// with checksum_type. When checksum_type is not set packer will guess the
// checksumming type based on checksum length. checksum can be also be a
// file or an URL, in which case checksum_type must be set to file; the
// go-getter will download it and use the first hash found.
Checksum string `mapstructure:"checksum" required:"true"`
// The type of the checksum specified in checksum.
// Valid values are none, md5, sha1, sha256, or sha512. Although the
// checksum will not be verified when checksum_type is set to "none", this is
// not recommended since OVA files can be very large and corruption does happen
// from time to time.
ChecksumType string `mapstructure:"checksum_type" required:"false"`
// Valid values are none, md5, sha1, sha256, or sha512. Although the
// checksum will not be verified when checksum_type is set to "none", this is
// not recommended since OVA files can be very large and corruption does happen
// from time to time.
ChecksumType string `mapstructure:"checksum_type" required:"false"`
// The method by which guest additions are
// made available to the guest for installation. Valid options are upload,
// attach, or disable. If the mode is attach the guest additions ISO will
// be attached as a CD device to the virtual machine. If the mode is upload
// the guest additions ISO will be uploaded to the path specified by
// guest_additions_path. The default value is upload. If disable is used,
// guest additions won't be downloaded, either.
GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"`
// made available to the guest for installation. Valid options are upload,
// attach, or disable. If the mode is attach the guest additions ISO will
// be attached as a CD device to the virtual machine. If the mode is upload
// the guest additions ISO will be uploaded to the path specified by
// guest_additions_path. The default value is upload. If disable is used,
// guest additions won't be downloaded, either.
GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"`
// The path on the guest virtual machine
// where the VirtualBox guest additions ISO will be uploaded. By default this
// is VBoxGuestAdditions.iso which should upload into the login directory of
// the user. This is a configuration
// template where the Version
// variable is replaced with the VirtualBox version.
GuestAdditionsPath string `mapstructure:"guest_additions_path" required:"false"`
// where the VirtualBox guest additions ISO will be uploaded. By default this
// is VBoxGuestAdditions.iso which should upload into the login directory of
// the user. This is a configuration
// template where the Version
// variable is replaced with the VirtualBox version.
GuestAdditionsPath string `mapstructure:"guest_additions_path" required:"false"`
// The interface type to use to mount
// guest additions when guest_additions_mode is set to attach. Will
// default to the value set in iso_interface, if iso_interface is set.
// Will default to "ide", if iso_interface is not set. Options are "ide" and
// "sata".
GuestAdditionsInterface string `mapstructure:"guest_additions_interface" required:"false"`
// guest additions when guest_additions_mode is set to attach. Will
// default to the value set in iso_interface, if iso_interface is set.
// Will default to "ide", if iso_interface is not set. Options are "ide" and
// "sata".
GuestAdditionsInterface string `mapstructure:"guest_additions_interface" required:"false"`
// The SHA256 checksum of the guest
// additions ISO that will be uploaded to the guest VM. By default the
// checksums will be downloaded from the VirtualBox website, so this only needs
// to be set if you want to be explicit about the checksum.
GuestAdditionsSHA256 string `mapstructure:"guest_additions_sha256" required:"false"`
// additions ISO that will be uploaded to the guest VM. By default the
// checksums will be downloaded from the VirtualBox website, so this only needs
// to be set if you want to be explicit about the checksum.
GuestAdditionsSHA256 string `mapstructure:"guest_additions_sha256" required:"false"`
// The URL to the guest additions ISO
// to upload. This can also be a file URL if the ISO is at a local path. By
// default, the VirtualBox builder will attempt to find the guest additions ISO
// on the local file system. If it is not available locally, the builder will
// download the proper guest additions ISO from the internet.
GuestAdditionsURL string `mapstructure:"guest_additions_url" required:"false"`
// to upload. This can also be a file URL if the ISO is at a local path. By
// default, the VirtualBox builder will attempt to find the guest additions ISO
// on the local file system. If it is not available locally, the builder will
// download the proper guest additions ISO from the internet.
GuestAdditionsURL string `mapstructure:"guest_additions_url" required:"false"`
// Additional flags to pass to
// VBoxManage import. This can be used to add additional command-line flags
// such as --eula-accept to accept a EULA in the OVF.
ImportFlags []string `mapstructure:"import_flags" required:"false"`
// VBoxManage import. This can be used to add additional command-line flags
// such as --eula-accept to accept a EULA in the OVF.
ImportFlags []string `mapstructure:"import_flags" required:"false"`
// Additional options to pass to the
// VBoxManage import. This can be useful for passing keepallmacs or
// keepnatmacs options for existing ovf images.
ImportOpts string `mapstructure:"import_opts" required:"false"`
// VBoxManage import. This can be useful for passing keepallmacs or
// keepnatmacs options for existing ovf images.
ImportOpts string `mapstructure:"import_opts" required:"false"`
// The path to an OVF or OVA file that acts as the
// source of this build. This currently must be a local file.
SourcePath string `mapstructure:"source_path" required:"true"`
// source of this build. This currently must be a local file.
SourcePath string `mapstructure:"source_path" required:"true"`
// The path where the OVA should be saved
// after download. By default, it will go in the packer cache, with a hash of
// the original filename as its name.
TargetPath string `mapstructure:"target_path" required:"false"`
// after download. By default, it will go in the packer cache, with a hash of
// the original filename as its name.
TargetPath string `mapstructure:"target_path" required:"false"`
// This is the name of the OVF file for the new virtual
// machine, without the file extension. By default this is packer-BUILDNAME,
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// machine, without the file extension. By default this is packer-BUILDNAME,
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// Set this to true if you would like to keep
// the VM registered with virtualbox. Defaults to false.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
// the VM registered with virtualbox. Defaults to false.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
// Defaults to false. When enabled, Packer will
// not export the VM. Useful if the build output is not the resultant image,
// but created inside the VM.
SkipExport bool `mapstructure:"skip_export" required:"false"`
// not export the VM. Useful if the build output is not the resultant image,
// but created inside the VM.
SkipExport bool `mapstructure:"skip_export" required:"false"`
ctx interpolate.Context
}

View File

@ -17,41 +17,41 @@ import (
type DriverConfig struct {
// Path to "VMware Fusion.app". By default this is
// /Applications/VMware Fusion.app but this setting allows you to
// customize this.
FusionAppPath string `mapstructure:"fusion_app_path" required:"false"`
// /Applications/VMware Fusion.app but this setting allows you to
// customize this.
FusionAppPath string `mapstructure:"fusion_app_path" 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
// for this currently is esx5. If this is not set, a desktop product will
// be used. By default, this is not set.
RemoteType string `mapstructure:"remote_type" required:"false"`
// build this VM rather than a local desktop product. The only value accepted
// for this currently is esx5. If this is not set, a desktop product will
// be used. By default, this is not set.
RemoteType string `mapstructure:"remote_type" required:"false"`
// The path to the datastore where the VM will be stored
// on the ESXi machine.
RemoteDatastore string `mapstructure:"remote_datastore" required:"false"`
// on the ESXi machine.
RemoteDatastore string `mapstructure:"remote_datastore" required:"false"`
// The path to the datastore where supporting files
// will be stored during the build on the remote machine.
RemoteCacheDatastore string `mapstructure:"remote_cache_datastore" required:"false"`
// will be stored during the build on the remote machine.
RemoteCacheDatastore string `mapstructure:"remote_cache_datastore" required:"false"`
// The path where the ISO and/or floppy files will
// be stored during the build on the remote machine. The path is relative to
// the remote_cache_datastore on the remote machine.
RemoteCacheDirectory string `mapstructure:"remote_cache_directory" required:"false"`
// be stored during the build on the remote machine. The path is relative to
// the remote_cache_datastore on the remote machine.
RemoteCacheDirectory string `mapstructure:"remote_cache_directory" required:"false"`
// The host of the remote machine used for access.
// This is only required if remote_type is enabled.
RemoteHost string `mapstructure:"remote_host" required:"false"`
// This is only required if remote_type is enabled.
RemoteHost string `mapstructure:"remote_host" required:"false"`
// The SSH port of the remote machine
RemotePort int `mapstructure:"remote_port" required:"false"`
RemotePort int `mapstructure:"remote_port" required:"false"`
// The SSH username used to access the remote machine.
RemoteUser string `mapstructure:"remote_username" required:"false"`
RemoteUser string `mapstructure:"remote_username" required:"false"`
// The SSH password for access to the remote machine.
RemotePassword string `mapstructure:"remote_password" required:"false"`
RemotePassword string `mapstructure:"remote_password" required:"false"`
// The SSH key for access to the remote machine.
RemotePrivateKey string `mapstructure:"remote_private_key_file" required:"false"`
RemotePrivateKey string `mapstructure:"remote_private_key_file" required:"false"`
// When Packer is preparing to run a
// remote esxi build, and export is not disable, by default it runs a no-op
// ovftool command to make sure that the remote_username and remote_password
// given are valid. If you set this flag to true, Packer will skip this
// validation. Default: false.
SkipValidateCredentials bool `mapstructure:"skip_validate_credentials" required:"false"`
// remote esxi build, and export is not disable, by default it runs a no-op
// ovftool command to make sure that the remote_username and remote_password
// given are valid. If you set this flag to true, Packer will skip this
// validation. Default: false.
SkipValidateCredentials bool `mapstructure:"skip_validate_credentials" required:"false"`
}
func (c *DriverConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -10,44 +10,44 @@ import (
type ExportConfig struct {
// Either "ovf", "ova" or "vmx", this specifies the output
// format of the exported virtual machine. This defaults to "ovf".
// Before using this option, you need to install ovftool. This option
// currently only works when option remote_type is set to "esx5".
// Since ovftool is only capable of password based authentication
// remote_password must be set when exporting the VM.
Format string `mapstructure:"format" required:"false"`
// format of the exported virtual machine. This defaults to "ovf".
// Before using this option, you need to install ovftool. This option
// currently only works when option remote_type is set to "esx5".
// Since ovftool is only capable of password based authentication
// remote_password must be set when exporting the VM.
Format string `mapstructure:"format" required:"false"`
// Extra options to pass to ovftool
// during export. Each item in the array is a new argument. The options
// --noSSLVerify, --skipManifestCheck, and --targetType are reserved,
// and should not be passed to this argument.
// Currently, exporting the build VM (with ovftool) is only supported when
// building on ESXi e.g. when remote_type is set to esx5. See the
// Building on a Remote vSphere
// Hypervisor
// section below for more info.
// during export. Each item in the array is a new argument. The options
// --noSSLVerify, --skipManifestCheck, and --targetType are reserved,
// and should not be passed to this argument.
// Currently, exporting the build VM (with ovftool) is only supported when
// building on ESXi e.g. when remote_type is set to esx5. See the
// Building on a Remote vSphere
// Hypervisor
// section below for more info.
OVFToolOptions []string `mapstructure:"ovftool_options" required:"false"`
// Defaults to false. When enabled, Packer will
// not export the VM. Useful if the build output is not the resultant
// image, but created inside the VM.
// Currently, exporting the build VM is only supported when building on
// ESXi e.g. when remote_type is set to esx5. See the Building on a
// Remote vSphere
// Hypervisor
// section below for more info.
SkipExport bool `mapstructure:"skip_export" required:"false"`
// not export the VM. Useful if the build output is not the resultant
// image, but created inside the VM.
// Currently, exporting the build VM is only supported when building on
// ESXi e.g. when remote_type is set to esx5. See the Building on a
// Remote vSphere
// Hypervisor
// section below for more info.
SkipExport bool `mapstructure:"skip_export" required:"false"`
// Set this to true if you would like to keep
// the VM registered with the remote ESXi server. If you do not need to export
// the vm, then also set skip_export: true in order to avoid an unnecessary
// step of using ovftool to export the vm. Defaults to false.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
// the VM registered with the remote ESXi server. If you do not need to export
// the vm, then also set skip_export: true in order to avoid an unnecessary
// step of using ovftool to export the vm. Defaults to false.
KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
// VMware-created disks are defragmented and
// compacted at the end of the build process using vmware-vdiskmanager or
// vmkfstools in ESXi. In certain rare cases, this might actually end up
// making the resulting disks slightly larger. If you find this to be the case,
// you can disable compaction using this configuration value. Defaults to
// false. Default to true for ESXi when disk_type_id is not explicitly
// defined and false otherwise.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
// compacted at the end of the build process using vmware-vdiskmanager or
// vmkfstools in ESXi. In certain rare cases, this might actually end up
// making the resulting disks slightly larger. If you find this to be the case,
// you can disable compaction using this configuration value. Defaults to
// false. Default to true for ESXi when disk_type_id is not explicitly
// defined and false otherwise.
SkipCompaction bool `mapstructure:"skip_compaction" required:"false"`
}
func (c *ExportConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -13,40 +13,40 @@ import (
type HWConfig struct {
// The number of cpus to use when building the VM.
CpuCount int `mapstructure:"cpus" required:"false"`
CpuCount int `mapstructure:"cpus" required:"false"`
// The amount of memory to use when building the VM
// in megabytes.
// in megabytes.
MemorySize int `mapstructure:"memory" required:"false"`
// The number of cores per socket to use when building the VM.
// This corresponds to the cpuid.coresPerSocket option in the .vmx file.
CoreCount int `mapstructure:"cores" required:"false"`
// This corresponds to the cpuid.coresPerSocket option in the .vmx file.
CoreCount int `mapstructure:"cores" required:"false"`
// This is the network type that the virtual machine will
// be created with. This can be one of the generic values that map to a device
// such as hostonly, nat, or bridged. If the network is not one of these
// values, then it is assumed to be a VMware network device. (VMnet0..x)
Network string `mapstructure:"network" required:"false"`
// be created with. This can be one of the generic values that map to a device
// such as hostonly, nat, or bridged. If the network is not one of these
// values, then it is assumed to be a VMware network device. (VMnet0..x)
Network string `mapstructure:"network" required:"false"`
// This is the ethernet adapter type the the
// virtual machine will be created with. By default the e1000 network adapter
// type will be used by Packer. For more information, please consult the
//
// Choosing a network adapter for your virtual machine for desktop VMware
// clients. For ESXi, refer to the proper ESXi documentation.
// virtual machine will be created with. By default the e1000 network adapter
// type will be used by Packer. For more information, please consult the
//
// Choosing a network adapter for your virtual machine for desktop VMware
// clients. For ESXi, refer to the proper ESXi documentation.
NetworkAdapterType string `mapstructure:"network_adapter_type" required:"false"`
// Specify whether to enable VMware's virtual soundcard
// device when building the VM. Defaults to false.
// device when building the VM. Defaults to false.
Sound bool `mapstructure:"sound" required:"false"`
// Enable VMware's USB bus when building the guest VM.
// Defaults to false. To enable usage of the XHCI bus for USB 3 (5 Gbit/s),
// one can use the vmx_data option to enable it by specifying true for
// the usb_xhci.present property.
USB bool `mapstructure:"usb" required:"false"`
// Defaults to false. To enable usage of the XHCI bus for USB 3 (5 Gbit/s),
// one can use the vmx_data option to enable it by specifying true for
// the usb_xhci.present property.
USB bool `mapstructure:"usb" required:"false"`
// This specifies a serial port to add to the VM.
// It has a format of Type:option1,option2,.... The field Type can be one
// of the following values: FILE, DEVICE, PIPE, AUTO, or NONE.
Serial string `mapstructure:"serial" required:"false"`
// It has a format of Type:option1,option2,.... The field Type can be one
// of the following values: FILE, DEVICE, PIPE, AUTO, or NONE.
Serial string `mapstructure:"serial" required:"false"`
// This specifies a parallel port to add to the VM. It
// has the format of Type:option1,option2,.... Type can be one of the
// following values: FILE, DEVICE, AUTO, or NONE.
// has the format of Type:option1,option2,.... Type can be one of the
// following values: FILE, DEVICE, AUTO, or NONE.
Parallel string `mapstructure:"parallel" required:"false"`
}

View File

@ -11,11 +11,11 @@ import (
type OutputConfig struct {
// This is the path to the directory where the
// resulting virtual machine will be created. This may be relative or absolute.
// If relative, the path is relative to the working directory when packer
// is executed. This directory must not exist or be empty prior to running
// the builder. By default this is output-BUILDNAME where "BUILDNAME" is the
// name of the build.
// resulting virtual machine will be created. This may be relative or absolute.
// If relative, the path is relative to the working directory when packer
// is executed. This directory must not exist or be empty prior to running
// the builder. By default this is output-BUILDNAME where "BUILDNAME" is the
// name of the build.
OutputDir string `mapstructure:"output_directory" required:"false"`
}

View File

@ -10,28 +10,28 @@ import (
type RunConfig struct {
// Packer defaults to building VMware virtual machines
// by launching a GUI that shows the console of the machine being built. When
// this value is set to true, the machine will start without a console. For
// VMware machines, Packer will output VNC connection information in case you
// need to connect to the console to debug the build process.
// by launching a GUI that shows the console of the machine being built. When
// this value is set to true, the machine will start without a console. For
// VMware machines, Packer will output VNC connection information in case you
// need to connect to the console to debug the build process.
Headless bool `mapstructure:"headless" required:"false"`
// The IP address that should be
// binded to for VNC. By default packer will use 127.0.0.1 for this. If you
// wish to bind to all interfaces use 0.0.0.0.
VNCBindAddress string `mapstructure:"vnc_bind_address" required:"false"`
// binded to for VNC. By default packer will use 127.0.0.1 for this. If you
// wish to bind to all interfaces use 0.0.0.0.
VNCBindAddress string `mapstructure:"vnc_bind_address" required:"false"`
// The minimum and maximum port
// to use for VNC access to the virtual machine. The builder uses VNC to type
// the initial boot_command. Because Packer generally runs in parallel,
// Packer uses a randomly chosen port in this range that appears available. By
// default this is 5900 to 6000. The minimum and maximum ports are
// inclusive.
VNCPortMin int `mapstructure:"vnc_port_min" required:"false"`
VNCPortMax int `mapstructure:"vnc_port_max"`
// to use for VNC access to the virtual machine. The builder uses VNC to type
// the initial boot_command. Because Packer generally runs in parallel,
// Packer uses a randomly chosen port in this range that appears available. By
// default this is 5900 to 6000. The minimum and maximum ports are
// inclusive.
VNCPortMin int `mapstructure:"vnc_port_min" required:"false"`
VNCPortMax int `mapstructure:"vnc_port_max"`
// Don't auto-generate a VNC password that
// is used to secure the VNC communication with the VM. This must be set to
// true if building on ESXi 6.5 and 6.7 with VNC enabled. Defaults to
// false.
VNCDisablePassword bool `mapstructure:"vnc_disable_password" required:"false"`
// is used to secure the VNC communication with the VM. This must be set to
// true if building on ESXi 6.5 and 6.7 with VNC enabled. Defaults to
// false.
VNCDisablePassword bool `mapstructure:"vnc_disable_password" required:"false"`
}
func (c *RunConfig) Prepare(ctx *interpolate.Context) (errs []error) {

View File

@ -11,13 +11,13 @@ import (
type ShutdownConfig struct {
// The command to use to gracefully shut down the
// machine once all the provisioning is done. By default this is an empty
// string, which tells Packer to just forcefully shut down the machine.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// machine once all the provisioning is done. By default this is an empty
// string, which tells Packer to just forcefully shut down the machine.
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
// The amount of time to wait after executing the
// shutdown_command for the virtual machine to actually shut down. If it
// doesn't shut down in this time, it is an error. By default, the timeout is
// 5m or five minutes.
// shutdown_command for the virtual machine to actually shut down. If it
// doesn't shut down in this time, it is an error. By default, the timeout is
// 5m or five minutes.
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
ShutdownTimeout time.Duration ``

View File

@ -8,17 +8,17 @@ import (
type ToolsConfig struct {
// The flavor of the VMware Tools ISO to
// upload into the VM. Valid values are darwin, linux, and windows. By
// default, this is empty, which means VMware tools won't be uploaded.
// upload into the VM. Valid values are darwin, linux, and windows. By
// default, this is empty, which means VMware tools won't be uploaded.
ToolsUploadFlavor string `mapstructure:"tools_upload_flavor" required:"false"`
// The path in the VM to upload the
// VMware tools. This only takes effect if tools_upload_flavor is non-empty.
// This is a configuration
// template that has a single
// valid variable: Flavor, which will be the value of tools_upload_flavor.
// By default the upload path is set to {{.Flavor}}.iso. This setting is not
// used when remote_type is esx5.
ToolsUploadPath string `mapstructure:"tools_upload_path" required:"false"`
// VMware tools. This only takes effect if tools_upload_flavor is non-empty.
// This is a configuration
// template that has a single
// valid variable: Flavor, which will be the value of tools_upload_flavor.
// By default the upload path is set to {{.Flavor}}.iso. This setting is not
// used when remote_type is esx5.
ToolsUploadPath string `mapstructure:"tools_upload_path" required:"false"`
}
func (c *ToolsConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -8,26 +8,26 @@ import (
type VMXConfig struct {
// Arbitrary key/values to enter
// 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"`
// 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"`
// Identical to vmx_data,
// 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"`
// 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"`
// Remove all ethernet interfaces
// 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"`
// 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"`
// The name that will appear in your vSphere client,
// 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"`
// 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"`
}
func (c *VMXConfig) Prepare(ctx *interpolate.Context) []error {

View File

@ -32,69 +32,69 @@ type Config struct {
vmwcommon.VMXConfig `mapstructure:",squash"`
vmwcommon.ExportConfig `mapstructure:",squash"`
// The size(s) of any additional
// hard disks for the VM in megabytes. If this is not specified then the VM
// will only contain a primary hard disk. The builder uses expandable, not
// fixed-size virtual hard disks, so the actual file representing the disk will
// not use the full size unless it is full.
// hard disks for the VM in megabytes. If this is not specified then the VM
// will only contain a primary hard disk. The builder uses expandable, not
// fixed-size virtual hard disks, so the actual file representing the disk will
// not use the full size unless it is full.
AdditionalDiskSize []uint `mapstructure:"disk_additional_size" required:"false"`
// The adapter type of the VMware virtual disk
// to create. This option is for advanced usage, modify only if you know what
// you're doing. Some of the options you can specify are ide, sata, nvme
// or scsi (which uses the "lsilogic" scsi interface by default). If you
// specify another option, Packer will assume that you're specifying a scsi
// interface of that specified type. For more information, please consult the
//
// Virtual Disk Manager User's Guide for desktop VMware clients.
// For ESXi, refer to the proper ESXi documentation.
DiskAdapterType string `mapstructure:"disk_adapter_type" required:"false"`
// to create. This option is for advanced usage, modify only if you know what
// you're doing. Some of the options you can specify are ide, sata, nvme
// or scsi (which uses the "lsilogic" scsi interface by default). If you
// specify another option, Packer will assume that you're specifying a scsi
// interface of that specified type. For more information, please consult the
//
// Virtual Disk Manager User's Guide for desktop VMware clients.
// For ESXi, refer to the proper ESXi documentation.
DiskAdapterType string `mapstructure:"disk_adapter_type" required:"false"`
// The filename of the virtual disk that'll be created,
// without the extension. This defaults to packer.
DiskName string `mapstructure:"vmdk_name" required:"false"`
// without the extension. This defaults to packer.
DiskName string `mapstructure:"vmdk_name" required:"false"`
// The size of the hard disk for the VM in megabytes.
// The builder uses expandable, not fixed-size virtual hard disks, so the
// actual file representing the disk will not use the full size unless it
// is full. By default this is set to 40000 (about 40 GB).
DiskSize uint `mapstructure:"disk_size" required:"false"`
// The builder uses expandable, not fixed-size virtual hard disks, so the
// actual file representing the disk will not use the full size unless it
// is full. By default this is set to 40000 (about 40 GB).
DiskSize uint `mapstructure:"disk_size" required:"false"`
// The type of VMware virtual disk to create. This
// option is for advanced usage.
DiskTypeId string `mapstructure:"disk_type_id" required:"false"`
// option is for advanced usage.
DiskTypeId string `mapstructure:"disk_type_id" required:"false"`
// Either "ovf", "ova" or "vmx", this specifies the output
// format of the exported virtual machine. This defaults to "ovf".
// Before using this option, you need to install ovftool. This option
// currently only works when option remote_type is set to "esx5".
// Since ovftool is only capable of password based authentication
// remote_password must be set when exporting the VM.
Format string `mapstructure:"format" required:"false"`
// format of the exported virtual machine. This defaults to "ovf".
// Before using this option, you need to install ovftool. This option
// currently only works when option remote_type is set to "esx5".
// Since ovftool is only capable of password based authentication
// remote_password must be set when exporting the VM.
Format string `mapstructure:"format" required:"false"`
// The adapter type (or bus) that will be used
// by the cdrom device. This is chosen by default based on the disk adapter
// type. VMware tends to lean towards ide for the cdrom device unless
// sata is chosen for the disk adapter and so Packer attempts to mirror
// this logic. This field can be specified as either ide, sata, or scsi.
// by the cdrom device. This is chosen by default based on the disk adapter
// type. VMware tends to lean towards ide for the cdrom device unless
// sata is chosen for the disk adapter and so Packer attempts to mirror
// this logic. This field can be specified as either ide, sata, or scsi.
CdromAdapterType string `mapstructure:"cdrom_adapter_type" required:"false"`
// The guest OS type being installed. This will be
// set in the VMware VMX. By default this is other. By specifying a more
// specific OS type, VMware may perform some optimizations or virtual hardware
// changes to better support the operating system running in the
// virtual machine.
// set in the VMware VMX. By default this is other. By specifying a more
// specific OS type, VMware may perform some optimizations or virtual hardware
// changes to better support the operating system running in the
// virtual machine.
GuestOSType string `mapstructure:"guest_os_type" required:"false"`
// The vmx hardware
// version
// for the new virtual machine. Only the default value has been tested, any
// other value is experimental. Default value is 9.
Version string `mapstructure:"version" required:"false"`
// version
// for the new virtual machine. Only the default value has been tested, any
// other value is experimental. Default value is 9.
Version string `mapstructure:"version" required:"false"`
// This is the name of the VMX file for the new virtual
// machine, without the file extension. By default this is packer-BUILDNAME,
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// machine, without the file extension. By default this is packer-BUILDNAME,
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
VMXDiskTemplatePath string `mapstructure:"vmx_disk_template_path"`
// Path to a configuration
// template that defines the
// contents of the virtual machine VMX file for VMware. This is for advanced
// users only as this can render the virtual machine non-functional. See
// below for more information. For basic VMX modifications, try
// vmx_data first.
VMXTemplatePath string `mapstructure:"vmx_template_path" required:"false"`
// template that defines the
// contents of the virtual machine VMX file for VMware. This is for advanced
// users only as this can render the virtual machine non-functional. See
// below for more information. For basic VMX modifications, try
// vmx_data first.
VMXTemplatePath string `mapstructure:"vmx_template_path" required:"false"`
ctx interpolate.Context
}

View File

@ -29,21 +29,21 @@ type Config struct {
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.
Linked bool `mapstructure:"linked" required:"false"`
// the virtual machine specified in source_path. The resultant virtual
// machine is fully independant from the parent it was cloned from.
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
// for this currently is esx5. If this is not set, a desktop product will
// be used. By default, this is not set.
// build this VM rather than a local desktop product. The only value accepted
// for this currently is esx5. If this is not set, a desktop product will
// be used. By default, this is not set.
RemoteType string `mapstructure:"remote_type" required:"false"`
// Path to the source VMX file to clone. If
// remote_type is enabled then this specifies a path on the remote_host.
// remote_type is enabled then this specifies a path on the remote_host.
SourcePath string `mapstructure:"source_path" required:"true"`
// This is the name of the VMX file for the new virtual
// machine, without the file extension. By default this is packer-BUILDNAME,
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
// machine, without the file extension. By default this is packer-BUILDNAME,
// where "BUILDNAME" is the name of the build.
VMName string `mapstructure:"vm_name" required:"false"`
ctx interpolate.Context
}

View File

@ -28,81 +28,81 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
Communicator communicator.Config `mapstructure:",squash"`
// Non standard api endpoint URL.
Endpoint string `mapstructure:"endpoint" required:"false"`
Endpoint string `mapstructure:"endpoint" required:"false"`
// The folder ID that will be used to launch instances and store images.
// Alternatively you may set value by environment variable YC_FOLDER_ID.
FolderID string `mapstructure:"folder_id" required:"true"`
// Path to file with Service Account key in json format. This
// is an alternative method to authenticate to Yandex.Cloud. Alternatively you may set environment variable
// YC_SERVICE_ACCOUNT_KEY_FILE.
// Alternatively you may set value by environment variable YC_FOLDER_ID.
FolderID string `mapstructure:"folder_id" required:"true"`
// Path to file with Service Account key in json format. This
// is an alternative method to authenticate to Yandex.Cloud. Alternatively you may set environment variable
// YC_SERVICE_ACCOUNT_KEY_FILE.
ServiceAccountKeyFile string `mapstructure:"service_account_key_file" required:"false"`
// OAuth token to use to authenticate to Yandex.Cloud. Alternatively you may set
// value by environment variable YC_TOKEN.
Token string `mapstructure:"token" required:"true"`
// value by environment variable YC_TOKEN.
Token string `mapstructure:"token" required:"true"`
// The name of the disk, if unset the instance name
// will be used.
DiskName string `mapstructure:"disk_name" required:"false"`
// will be used.
DiskName string `mapstructure:"disk_name" required:"false"`
// The size of the disk in GB. This defaults to 10, which is 10GB.
DiskSizeGb int `mapstructure:"disk_size_gb" required:"false"`
DiskSizeGb int `mapstructure:"disk_size_gb" required:"false"`
// Specify disk type for the launched instance. Defaults to network-hdd.
DiskType string `mapstructure:"disk_type" required:"false"`
DiskType string `mapstructure:"disk_type" required:"false"`
// The description of the resulting image.
ImageDescription string `mapstructure:"image_description" required:"false"`
ImageDescription string `mapstructure:"image_description" required:"false"`
// The family name of the resulting image.
ImageFamily string `mapstructure:"image_family" required:"false"`
ImageFamily string `mapstructure:"image_family" required:"false"`
// Key/value pair labels to
// apply to the created image.
ImageLabels map[string]string `mapstructure:"image_labels" required:"false"`
// apply to the created image.
ImageLabels map[string]string `mapstructure:"image_labels" required:"false"`
// The unique name of the resulting image. Defaults to
// packer-{{timestamp}}.
ImageName string `mapstructure:"image_name" required:"false"`
// packer-{{timestamp}}.
ImageName string `mapstructure:"image_name" required:"false"`
// License IDs that indicate which licenses are attached to resulting image.
ImageProductIDs []string `mapstructure:"image_product_ids" required:"false"`
ImageProductIDs []string `mapstructure:"image_product_ids" required:"false"`
// The number of cores available to the instance.
InstanceCores int `mapstructure:"instance_cores" required:"false"`
InstanceCores int `mapstructure:"instance_cores" required:"false"`
// The amount of memory available to the instance, specified in gigabytes.
InstanceMemory int `mapstructure:"instance_mem_gb" required:"false"`
InstanceMemory int `mapstructure:"instance_mem_gb" required:"false"`
// The name assigned to the instance.
InstanceName string `mapstructure:"instance_name" required:"false"`
InstanceName string `mapstructure:"instance_name" required:"false"`
// Key/value pair labels to apply to
// the launched instance.
Labels map[string]string `mapstructure:"labels" required:"false"`
// the launched instance.
Labels map[string]string `mapstructure:"labels" required:"false"`
// Identifier of the hardware platform configuration for the instance. This defaults to standard-v1.
PlatformID string `mapstructure:"platform_id" required:"false"`
PlatformID string `mapstructure:"platform_id" required:"false"`
// Metadata applied to the launched
// instance.
Metadata map[string]string `mapstructure:"metadata" required:"false"`
// instance.
Metadata map[string]string `mapstructure:"metadata" required:"false"`
// File path to save serial port output of the launched instance.
SerialLogFile string `mapstructure:"serial_log_file" required:"false"`
SerialLogFile string `mapstructure:"serial_log_file" required:"false"`
// The source image family to create the new image
// from. You can also specify source_image_id instead. Just one of a source_image_id or
// source_image_family must be specified. Example: ubuntu-1804-lts
SourceImageFamily string `mapstructure:"source_image_family" required:"true"`
// from. You can also specify source_image_id instead. Just one of a source_image_id or
// source_image_family must be specified. Example: ubuntu-1804-lts
SourceImageFamily string `mapstructure:"source_image_family" required:"true"`
// The ID of the folder containing the source image.
SourceImageFolderID string `mapstructure:"source_image_folder_id" required:"false"`
SourceImageFolderID string `mapstructure:"source_image_folder_id" required:"false"`
// The source image ID to use to create the new image
// from.
SourceImageID string `mapstructure:"source_image_id" required:"false"`
// The Yandex VPC subnet id to use for
// the launched instance. Note, the zone of the subnet must match the
// zone in which the VM is launched.
SubnetID string `mapstructure:"subnet_id" required:"false"`
// If set to true, then launched instance will have external internet
// access.
UseIPv4Nat bool `mapstructure:"use_ipv4_nat" required:"false"`
// from.
SourceImageID string `mapstructure:"source_image_id" required:"false"`
// The Yandex VPC subnet id to use for
// the launched instance. Note, the zone of the subnet must match the
// zone in which the VM is launched.
SubnetID string `mapstructure:"subnet_id" required:"false"`
// If set to true, then launched instance will have external internet
// access.
UseIPv4Nat bool `mapstructure:"use_ipv4_nat" required:"false"`
// Set to true to enable IPv6 for the instance being
// created. This defaults to false, or not enabled.
// -> Note: ~> Usage of IPv6 will be available in the future.
UseIPv6 bool `mapstructure:"use_ipv6" required:"false"`
// created. This defaults to false, or not enabled.
// -> Note: ~> Usage of IPv6 will be available in the future.
UseIPv6 bool `mapstructure:"use_ipv6" required:"false"`
// If true, use the instance's internal IP address
// instead of its external IP during building.
UseInternalIP bool `mapstructure:"use_internal_ip" required:"false"`
// instead of its external IP during building.
UseInternalIP bool `mapstructure:"use_internal_ip" required:"false"`
// The name of the zone to launch the instance. This defaults to ru-central1-a.
Zone string `mapstructure:"zone" required:"false"`
Zone string `mapstructure:"zone" required:"false"`
ctx interpolate.Context
ctx interpolate.Context
// The time to wait for instance state changes.
// Defaults to 5m.
// Defaults to 5m.
StateTimeout time.Duration `mapstructure:"state_timeout" required:"false"`
}