chroot

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: MPL-2.0 Imports: 27 Imported by: 1

Documentation

Overview

The chroot package is able to create an Amazon AMI without requiring the launch of a new instance for every build. It does this by attaching and mounting the root volume of another AMI and chrooting into that directory. It then creates an AMI from that attached drive.

Index

Constants

View Source
const BuilderId = "mitchellh.amazon.chroot"

The unique ID for this builder

View Source
const LOCK_EX = 2

See: http://linux.die.net/include/sys/file.h

View Source
const LOCK_NB = 4
View Source
const LOCK_UN = 8

Variables

This section is empty.

Functions

func AvailableDevice

func AvailableDevice() (string, error)

AvailableDevice finds an available device and returns it. Note that you should externally hold a flock or something in order to guarantee that this device is available across processes.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func (*Builder) ConfigSpec

func (b *Builder) ConfigSpec() hcldec.ObjectSpec

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error)

func (*Builder) Run

type Config

type Config struct {
	common.PackerConfig    `mapstructure:",squash"`
	awscommon.AMIConfig    `mapstructure:",squash"`
	awscommon.AccessConfig `mapstructure:",squash"`
	// Add one or more [block device
	// mappings](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
	// to the AMI. If this field is populated, and you are building from an
	// existing source image, the block device mappings in the source image
	// will be overwritten. This means you must have a block device mapping
	// entry for your root volume, `root_volume_size` and `root_device_name`.
	// See the [BlockDevices](#block-devices-configuration) documentation for
	// fields.
	AMIMappings awscommon.BlockDevices `mapstructure:"ami_block_device_mappings" hcl2-schema-generator:"ami_block_device_mappings,direct" required:"false"`
	// This is a list of devices to mount into the chroot environment. This
	// configuration parameter requires some additional documentation which is
	// in the Chroot Mounts section. Please read that section for more
	// information on how to use this.
	ChrootMounts [][]string `mapstructure:"chroot_mounts" required:"false"`
	// How to run shell commands. This defaults to `{{.Command}}`. This may be
	// useful to set if you want to set environmental variables or perhaps run
	// it with sudo or so on. This is a configuration template where the
	// .Command variable is replaced with the command to be run. Defaults to
	// `{{.Command}}`.
	CommandWrapper string `mapstructure:"command_wrapper" required:"false"`
	// Paths to files on the running EC2 instance that will be copied into the
	// chroot environment prior to provisioning. Defaults to /etc/resolv.conf
	// so that DNS lookups work. Pass an empty list to skip copying
	// /etc/resolv.conf. You may need to do this if you're building an image
	// that uses systemd.
	CopyFiles []string `mapstructure:"copy_files" required:"false"`
	// The path to the device where the root volume of the source AMI will be
	// attached. This defaults to "" (empty string), which forces Packer to
	// find an open device automatically.
	DevicePath string `mapstructure:"device_path" required:"false"`
	// When we call the mount command (by default mount -o device dir), the
	// string provided in nvme_mount_path will replace device in that command.
	// When this option is not set, device in that command will be something
	// like /dev/sdf1, mirroring the attached device name. This assumption
	// works for most instances but will fail with c5 and m5 instances. In
	// order to use the chroot builder with c5 and m5 instances, you must
	// manually set nvme_device_path and device_path.
	NVMEDevicePath string `mapstructure:"nvme_device_path" required:"false"`
	// Build a new volume instead of starting from an existing AMI root volume
	// snapshot. Default false. If true, source_ami/source_ami_filter are no
	// longer used and the following options become required:
	// ami_virtualization_type, pre_mount_commands and root_volume_size.
	FromScratch bool `mapstructure:"from_scratch" required:"false"`
	// Options to supply the mount command when mounting devices. Each option
	// will be prefixed with -o and supplied to the mount command ran by
	// Packer. Because this command is ran in a shell, user discretion is
	// advised. See this manual page for the mount command for valid file
	// system specific options.
	MountOptions []string `mapstructure:"mount_options" required:"false"`
	// The partition number containing the / partition. By default this is the
	// first partition of the volume, (for example, xvda1) but you can
	// designate the entire block device by setting "mount_partition": "0" in
	// your config, which will mount xvda instead.
	MountPartition string `mapstructure:"mount_partition" required:"false"`
	// The path where the volume will be mounted. This is where the chroot
	// environment will be. This defaults to
	// `/mnt/packer-amazon-chroot-volumes/{{.Device}}`. This is a configuration
	// template where the .Device variable is replaced with the name of the
	// device where the volume is attached.
	MountPath string `mapstructure:"mount_path" required:"false"`
	// As pre_mount_commands, but the commands are executed after mounting the
	// root device and before the extra mount and copy steps. The device and
	// mount path are provided by `{{.Device}}` and `{{.MountPath}}`.
	PostMountCommands []string `mapstructure:"post_mount_commands" required:"false"`
	// A series of commands to execute after attaching the root volume and
	// before mounting the chroot. This is not required unless using
	// from_scratch. If so, this should include any partitioning and filesystem
	// creation commands. The path to the device is provided by `{{.Device}}`.
	PreMountCommands []string `mapstructure:"pre_mount_commands" required:"false"`
	// The root device name. For example, xvda.
	RootDeviceName string `mapstructure:"root_device_name" required:"false"`
	// The size of the root volume in GB for the chroot environment and the
	// resulting AMI. Default size is the snapshot size of the source_ami
	// unless from_scratch is true, in which case this field must be defined.
	RootVolumeSize int64 `mapstructure:"root_volume_size" required:"false"`
	// The type of EBS volume for the chroot environment and resulting AMI. The
	// default value is the type of the source_ami, unless from_scratch is
	// true, in which case the default value is gp2. You can only specify io1
	// if building based on top of a source_ami which is also io1.
	RootVolumeType string `mapstructure:"root_volume_type" required:"false"`
	// The source AMI whose root volume will be copied and provisioned on the
	// currently running instance. This must be an EBS-backed AMI with a root
	// volume snapshot that you have access to. Note: this is not used when
	// from_scratch is set to true.
	SourceAmi string `mapstructure:"source_ami" required:"true"`
	// Filters used to populate the source_ami field. Example:
	//
	//“`json
	//{
	//	 "source_ami_filter": {
	//	 "filters": {
	//	  "virtualization-type": "hvm",
	//	  "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
	//	  "root-device-type": "ebs"
	//	},
	//	"owners": ["099720109477"],
	//	"most_recent": true
	//	 }
	//}
	//“`
	//
	//This selects the most recent Ubuntu 16.04 HVM EBS AMI from Canonical. NOTE:
	//This will fail unless *exactly* one AMI is returned. In the above example,
	//`most_recent` will cause this to succeed by selecting the newest image.
	//
	//-   `filters` (map[string,string] | multiple filters are allowed when seperated by commas) -
	//  filters used to select a `source_ami`.
	//	NOTE: This will fail unless *exactly* one AMI is returned. Any filter
	//	described in the docs for
	//	[DescribeImages](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html)
	//	is valid.
	//
	//-   `owners` (array of strings) - Filters the images by their owner. You
	//	may specify one or more AWS account IDs, "self" (which will use the
	//	account whose credentials you are using to run Packer), or an AWS owner
	//	alias: for example, "amazon", "aws-marketplace", or "microsoft". This
	//	option is required for security reasons.
	//
	//-   `most_recent` (boolean) - Selects the newest created image when true.
	//	This is most useful for selecting a daily distro build.
	//
	//You may set this in place of `source_ami` or in conjunction with it. If you
	//set this in conjunction with `source_ami`, the `source_ami` will be added
	//to the filter. The provided `source_ami` must meet all of the filtering
	//criteria provided in `source_ami_filter`; this pins the AMI returned by the
	//filter, but will cause Packer to fail if the `source_ami` does not exist.
	SourceAmiFilter awscommon.AmiFilterOptions `mapstructure:"source_ami_filter" required:"false"`
	// Key/value pair tags to apply to the volumes that are *launched*. This is
	// a [template engine](/packer/docs/templates/legacy_json_templates/engine), see [Build template
	// data](#build-template-data) for more information.
	RootVolumeTags map[string]string `mapstructure:"root_volume_tags" required:"false"`
	// Same as [`root_volume_tags`](#root_volume_tags) but defined as a
	// singular block containing a `key` and a `value` field. In HCL2 mode the
	// [`dynamic_block`](/packer/docs/templates/hcl_templates/expressions#dynamic-blocks)
	// will allow you to create those programatically.
	RootVolumeTag config.KeyValues `mapstructure:"root_volume_tag" required:"false"`
	// Whether or not to encrypt the volumes that are *launched*. By default, Packer will keep
	// the encryption setting to what it was in the source image when set to `false`. Setting true will
	// always result in an encrypted one.
	RootVolumeEncryptBoot config.Trilean `mapstructure:"root_volume_encrypt_boot" required:"false"`
	// ID, alias or ARN of the KMS key to use for *launched* volumes encryption.
	//
	// Set this value if you select `root_volume_encrypt_boot`, but don't want to use the
	// region's default KMS key.
	//
	// If you have a custom kms key you'd like to apply to the launch volume,
	// and are only building in one region, it is more efficient to set this
	// and `root_volume_encrypt_boot` to `true` and not use `encrypt_boot` and `kms_key_id`. This saves
	// potentially many minutes at the end of the build by preventing Packer
	// from having to copy and re-encrypt the image at the end of the build.
	//
	// For valid formats see *KmsKeyId* in the [AWS API docs -
	// CopyImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopyImage.html).
	// This field is validated by Packer, when using an alias, you will have to
	// prefix `kms_key_id` with `alias/`.
	RootVolumeKmsKeyId string `mapstructure:"root_volume_kms_key_id" required:"false"`
	// what architecture to use when registering the final AMI; valid options
	// are "arm64", "arm64_mac", "i386", "x86_64", or "x86_64_mac". Defaults to "x86_64".
	Architecture string `mapstructure:"ami_architecture" required:"false"`
	// The boot mode. Valid options are `legacy-bios` and `uefi`. See the documentation on
	// [boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) for
	// more information. Defaults to `legacy-bios` when `ami_architecture` is `x86_64` and
	// `uefi` when `ami_architecture` is `arm64`.
	BootMode string `mapstructure:"boot_mode" required:"false"`
	// Base64 representation of the non-volatile UEFI variable store. For more information
	// see [AWS documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/uefi-secure-boot-optionB.html).
	UefiData string `mapstructure:"uefi_data" required:"false"`
	// NitroTPM Support. Valid options are `v2.0`. See the documentation on
	// [NitroTPM Support](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enable-nitrotpm-support-on-ami.html) for
	// more information. Only enabled if a valid option is provided, otherwise ignored.
	TpmSupport string `mapstructure:"tpm_support" required:"false"`
	// contains filtered or unexported fields
}

Config is the configuration that is chained through the steps and settable from the template.

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*Config) GetContext

func (c *Config) GetContext() interpolate.Context

type FlatConfig

type FlatConfig struct {
	PackerBuildName         *string                           `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
	PackerBuilderType       *string                           `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
	PackerCoreVersion       *string                           `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
	PackerDebug             *bool                             `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
	PackerForce             *bool                             `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
	PackerOnError           *string                           `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
	PackerUserVars          map[string]string                 `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
	PackerSensitiveVars     []string                          `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
	AMIName                 *string                           `mapstructure:"ami_name" required:"true" cty:"ami_name" hcl:"ami_name"`
	AMIDescription          *string                           `mapstructure:"ami_description" required:"false" cty:"ami_description" hcl:"ami_description"`
	AMIVirtType             *string                           `mapstructure:"ami_virtualization_type" required:"false" cty:"ami_virtualization_type" hcl:"ami_virtualization_type"`
	AMIUsers                []string                          `mapstructure:"ami_users" required:"false" cty:"ami_users" hcl:"ami_users"`
	AMIGroups               []string                          `mapstructure:"ami_groups" required:"false" cty:"ami_groups" hcl:"ami_groups"`
	AMIOrgArns              []string                          `mapstructure:"ami_org_arns" required:"false" cty:"ami_org_arns" hcl:"ami_org_arns"`
	AMIOuArns               []string                          `mapstructure:"ami_ou_arns" required:"false" cty:"ami_ou_arns" hcl:"ami_ou_arns"`
	AMIProductCodes         []string                          `mapstructure:"ami_product_codes" required:"false" cty:"ami_product_codes" hcl:"ami_product_codes"`
	AMIRegions              []string                          `mapstructure:"ami_regions" required:"false" cty:"ami_regions" hcl:"ami_regions"`
	AMISkipRegionValidation *bool                             `mapstructure:"skip_region_validation" required:"false" cty:"skip_region_validation" hcl:"skip_region_validation"`
	AMITags                 map[string]string                 `mapstructure:"tags" required:"false" cty:"tags" hcl:"tags"`
	AMITag                  []config.FlatKeyValue             `mapstructure:"tag" required:"false" cty:"tag" hcl:"tag"`
	AMIENASupport           *bool                             `mapstructure:"ena_support" required:"false" cty:"ena_support" hcl:"ena_support"`
	AMISriovNetSupport      *bool                             `mapstructure:"sriov_support" required:"false" cty:"sriov_support" hcl:"sriov_support"`
	AMIForceDeregister      *bool                             `mapstructure:"force_deregister" required:"false" cty:"force_deregister" hcl:"force_deregister"`
	AMIForceDeleteSnapshot  *bool                             `mapstructure:"force_delete_snapshot" required:"false" cty:"force_delete_snapshot" hcl:"force_delete_snapshot"`
	AMIEncryptBootVolume    *bool                             `mapstructure:"encrypt_boot" required:"false" cty:"encrypt_boot" hcl:"encrypt_boot"`
	AMIKmsKeyId             *string                           `mapstructure:"kms_key_id" required:"false" cty:"kms_key_id" hcl:"kms_key_id"`
	AMIRegionKMSKeyIDs      map[string]string                 `mapstructure:"region_kms_key_ids" required:"false" cty:"region_kms_key_ids" hcl:"region_kms_key_ids"`
	AMISkipBuildRegion      *bool                             `mapstructure:"skip_save_build_region" cty:"skip_save_build_region" hcl:"skip_save_build_region"`
	AMIIMDSSupport          *string                           `mapstructure:"imds_support" required:"false" cty:"imds_support" hcl:"imds_support"`
	DeprecationTime         *string                           `mapstructure:"deprecate_at" cty:"deprecate_at" hcl:"deprecate_at"`
	SnapshotTags            map[string]string                 `mapstructure:"snapshot_tags" required:"false" cty:"snapshot_tags" hcl:"snapshot_tags"`
	SnapshotTag             []config.FlatKeyValue             `mapstructure:"snapshot_tag" required:"false" cty:"snapshot_tag" hcl:"snapshot_tag"`
	SnapshotUsers           []string                          `mapstructure:"snapshot_users" required:"false" cty:"snapshot_users" hcl:"snapshot_users"`
	SnapshotGroups          []string                          `mapstructure:"snapshot_groups" required:"false" cty:"snapshot_groups" hcl:"snapshot_groups"`
	AccessKey               *string                           `mapstructure:"access_key" required:"true" cty:"access_key" hcl:"access_key"`
	AssumeRole              *common.FlatAssumeRoleConfig      `mapstructure:"assume_role" required:"false" cty:"assume_role" hcl:"assume_role"`
	CustomEndpointEc2       *string                           `mapstructure:"custom_endpoint_ec2" required:"false" cty:"custom_endpoint_ec2" hcl:"custom_endpoint_ec2"`
	CredsFilename           *string                           `mapstructure:"shared_credentials_file" required:"false" cty:"shared_credentials_file" hcl:"shared_credentials_file"`
	DecodeAuthZMessages     *bool                             `` /* 133-byte string literal not displayed */
	InsecureSkipTLSVerify   *bool                             `mapstructure:"insecure_skip_tls_verify" required:"false" cty:"insecure_skip_tls_verify" hcl:"insecure_skip_tls_verify"`
	MaxRetries              *int                              `mapstructure:"max_retries" required:"false" cty:"max_retries" hcl:"max_retries"`
	MFACode                 *string                           `mapstructure:"mfa_code" required:"false" cty:"mfa_code" hcl:"mfa_code"`
	ProfileName             *string                           `mapstructure:"profile" required:"false" cty:"profile" hcl:"profile"`
	RawRegion               *string                           `mapstructure:"region" required:"true" cty:"region" hcl:"region"`
	SecretKey               *string                           `mapstructure:"secret_key" required:"true" cty:"secret_key" hcl:"secret_key"`
	SkipMetadataApiCheck    *bool                             `mapstructure:"skip_metadata_api_check" cty:"skip_metadata_api_check" hcl:"skip_metadata_api_check"`
	SkipCredsValidation     *bool                             `mapstructure:"skip_credential_validation" cty:"skip_credential_validation" hcl:"skip_credential_validation"`
	Token                   *string                           `mapstructure:"token" required:"false" cty:"token" hcl:"token"`
	VaultAWSEngine          *common.FlatVaultAWSEngineOptions `mapstructure:"vault_aws_engine" required:"false" cty:"vault_aws_engine" hcl:"vault_aws_engine"`
	PollingConfig           *common.FlatAWSPollingConfig      `mapstructure:"aws_polling" required:"false" cty:"aws_polling" hcl:"aws_polling"`
	AMIMappings             []common.FlatBlockDevice          `` /* 178-byte string literal not displayed */
	ChrootMounts            [][]string                        `mapstructure:"chroot_mounts" required:"false" cty:"chroot_mounts" hcl:"chroot_mounts"`
	CommandWrapper          *string                           `mapstructure:"command_wrapper" required:"false" cty:"command_wrapper" hcl:"command_wrapper"`
	CopyFiles               []string                          `mapstructure:"copy_files" required:"false" cty:"copy_files" hcl:"copy_files"`
	DevicePath              *string                           `mapstructure:"device_path" required:"false" cty:"device_path" hcl:"device_path"`
	NVMEDevicePath          *string                           `mapstructure:"nvme_device_path" required:"false" cty:"nvme_device_path" hcl:"nvme_device_path"`
	FromScratch             *bool                             `mapstructure:"from_scratch" required:"false" cty:"from_scratch" hcl:"from_scratch"`
	MountOptions            []string                          `mapstructure:"mount_options" required:"false" cty:"mount_options" hcl:"mount_options"`
	MountPartition          *string                           `mapstructure:"mount_partition" required:"false" cty:"mount_partition" hcl:"mount_partition"`
	MountPath               *string                           `mapstructure:"mount_path" required:"false" cty:"mount_path" hcl:"mount_path"`
	PostMountCommands       []string                          `mapstructure:"post_mount_commands" required:"false" cty:"post_mount_commands" hcl:"post_mount_commands"`
	PreMountCommands        []string                          `mapstructure:"pre_mount_commands" required:"false" cty:"pre_mount_commands" hcl:"pre_mount_commands"`
	RootDeviceName          *string                           `mapstructure:"root_device_name" required:"false" cty:"root_device_name" hcl:"root_device_name"`
	RootVolumeSize          *int64                            `mapstructure:"root_volume_size" required:"false" cty:"root_volume_size" hcl:"root_volume_size"`
	RootVolumeType          *string                           `mapstructure:"root_volume_type" required:"false" cty:"root_volume_type" hcl:"root_volume_type"`
	SourceAmi               *string                           `mapstructure:"source_ami" required:"true" cty:"source_ami" hcl:"source_ami"`
	SourceAmiFilter         *common.FlatAmiFilterOptions      `mapstructure:"source_ami_filter" required:"false" cty:"source_ami_filter" hcl:"source_ami_filter"`
	RootVolumeTags          map[string]string                 `mapstructure:"root_volume_tags" required:"false" cty:"root_volume_tags" hcl:"root_volume_tags"`
	RootVolumeTag           []config.FlatKeyValue             `mapstructure:"root_volume_tag" required:"false" cty:"root_volume_tag" hcl:"root_volume_tag"`
	RootVolumeEncryptBoot   *bool                             `mapstructure:"root_volume_encrypt_boot" required:"false" cty:"root_volume_encrypt_boot" hcl:"root_volume_encrypt_boot"`
	RootVolumeKmsKeyId      *string                           `mapstructure:"root_volume_kms_key_id" required:"false" cty:"root_volume_kms_key_id" hcl:"root_volume_kms_key_id"`
	Architecture            *string                           `mapstructure:"ami_architecture" required:"false" cty:"ami_architecture" hcl:"ami_architecture"`
	BootMode                *string                           `mapstructure:"boot_mode" required:"false" cty:"boot_mode" hcl:"boot_mode"`
	UefiData                *string                           `mapstructure:"uefi_data" required:"false" cty:"uefi_data" hcl:"uefi_data"`
	TpmSupport              *string                           `mapstructure:"tpm_support" required:"false" cty:"tpm_support" hcl:"tpm_support"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type StepAttachVolume

type StepAttachVolume struct {
	PollingConfig *awscommon.AWSPollingConfig
	// contains filtered or unexported fields
}

StepAttachVolume attaches the previously created volume to an available device location.

Produces:

device string - The location where the volume was attached.
attach_cleanup CleanupFunc

func (*StepAttachVolume) Cleanup

func (s *StepAttachVolume) Cleanup(state multistep.StateBag)

func (*StepAttachVolume) CleanupFunc

func (s *StepAttachVolume) CleanupFunc(state multistep.StateBag) error

func (*StepAttachVolume) Run

type StepCheckRootDevice

type StepCheckRootDevice struct{}

StepCheckRootDevice makes sure the root device on the AMI is EBS-backed.

func (*StepCheckRootDevice) Cleanup

func (*StepCheckRootDevice) Run

type StepCreateVolume

type StepCreateVolume struct {
	PollingConfig *awscommon.AWSPollingConfig

	RootVolumeSize        int64
	RootVolumeType        string
	RootVolumeTags        map[string]string
	RootVolumeEncryptBoot config.Trilean
	RootVolumeKmsKeyId    string
	Ctx                   interpolate.Context
	// contains filtered or unexported fields
}

StepCreateVolume creates a new volume from the snapshot of the root device of the AMI.

Produces:

volume_id string - The ID of the created volume

func (*StepCreateVolume) Cleanup

func (s *StepCreateVolume) Cleanup(state multistep.StateBag)

func (*StepCreateVolume) Run

type StepEarlyUnflock

type StepEarlyUnflock struct{}

StepEarlyUnflock unlocks the flock.

func (*StepEarlyUnflock) Cleanup

func (s *StepEarlyUnflock) Cleanup(state multistep.StateBag)

func (*StepEarlyUnflock) Run

type StepFlock

type StepFlock struct {
	// contains filtered or unexported fields
}

StepFlock provisions the instance within a chroot.

Produces:

flock_cleanup Cleanup - To perform early cleanup

func (*StepFlock) Cleanup

func (s *StepFlock) Cleanup(state multistep.StateBag)

func (*StepFlock) CleanupFunc

func (s *StepFlock) CleanupFunc(state multistep.StateBag) error

func (*StepFlock) Run

type StepInstanceInfo

type StepInstanceInfo struct{}

StepInstanceInfo verifies that this builder is running on an EC2 instance.

func (*StepInstanceInfo) Cleanup

func (s *StepInstanceInfo) Cleanup(multistep.StateBag)

func (*StepInstanceInfo) Run

type StepMountDevice

type StepMountDevice struct {
	MountOptions   []string
	MountPartition string

	GeneratedData *packerbuilderdata.GeneratedData
	// contains filtered or unexported fields
}

StepMountDevice mounts the attached device.

Produces:

mount_path string - The location where the volume was mounted.
mount_device_cleanup CleanupFunc - To perform early cleanup

func (*StepMountDevice) Cleanup

func (s *StepMountDevice) Cleanup(state multistep.StateBag)

func (*StepMountDevice) CleanupFunc

func (s *StepMountDevice) CleanupFunc(state multistep.StateBag) error

func (*StepMountDevice) Run

type StepPrepareDevice

type StepPrepareDevice struct {
	GeneratedData *packerbuilderdata.GeneratedData
}

StepPrepareDevice finds an available device and sets it.

func (*StepPrepareDevice) Cleanup

func (s *StepPrepareDevice) Cleanup(state multistep.StateBag)

func (*StepPrepareDevice) Run

type StepRegisterAMI

type StepRegisterAMI struct {
	PollingConfig            *awscommon.AWSPollingConfig
	RootVolumeSize           int64
	EnableAMIENASupport      config.Trilean
	EnableAMISriovNetSupport bool
	AMISkipBuildRegion       bool
	BootMode                 string
	UefiData                 string
	TpmSupport               string
}

StepRegisterAMI creates the AMI.

func (*StepRegisterAMI) Cleanup

func (s *StepRegisterAMI) Cleanup(state multistep.StateBag)

func (*StepRegisterAMI) Run

type StepSnapshot

type StepSnapshot struct {
	PollingConfig *awscommon.AWSPollingConfig
	// contains filtered or unexported fields
}

StepSnapshot creates a snapshot of the created volume.

Produces:

snapshot_id string - ID of the created snapshot

func (*StepSnapshot) Cleanup

func (s *StepSnapshot) Cleanup(state multistep.StateBag)

func (*StepSnapshot) Run

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL