packer/command
James Nugent b1ff8c3bfc builder/amazon: Add ebs-volume builder
This commit adds a builder that works like EBS builders, except does not
create an AMI, and instead is intended to create EBS volumes in an
initialized state. For example, the following template can be used to
create and export a set of 3 EBS Volumes in a ZFS zpool named `data` for
importing by instances running production systems:

```
{
	"variables": {
		"aws_access_key_id": "{{ env `AWS_ACCESS_KEY_ID` }}",
		"aws_secret_access_key": "{{ env `AWS_SECRET_ACCESS_KEY` }}",
		"region": "{{ env `AWS_REGION` }}",
		"source_ami": "{{ env `PACKER_SOURCE_AMI` }}",
		"vpc_id": "{{ env `PACKER_VPC_ID` }}",
		"subnet_id": "{{ env `PACKER_SUBNET_ID` }}"
	},
	"builders": [{
		"type": "amazon-ebs-volume",
		"access_key": "{{ user `aws_access_key_id` }}",
		"secret_key": "{{ user `aws_secret_access_key` }}",
		"region": "{{user `region`}}",
		"spot_price_auto_product": "Linux/UNIX (Amazon VPC)",

		"ssh_pty": true,
		"instance_type": "t2.medium",
		"vpc_id": "{{user `vpc_id` }}",
		"subnet_id": "{{user `subnet_id` }}",
		"associate_public_ip_address": true,
		"source_ami": "{{user `source_ami` }}",
		"ssh_username": "ubuntu",
		"ssh_timeout": "5m",

		"ebs_volumes": [
			{
				"device_name": "/dev/xvdf",
				"delete_on_termination": false,
				"volume_size": 10,
				"volume_type": "gp2",
				"tags": {
					"Name": "TeamCity-Data1",
					"zpool": "data",
					"Component": "TeamCity"
				}
			},
			{
				"device_name": "/dev/xvdg",
				"delete_on_termination": false,
				"volume_size": 10,
				"volume_type": "gp2",
				"tags": {
					"Name": "TeamCity-Data2",
					"zpool": "data",
					"Component": "TeamCity"
				}
			},
			{
				"device_name": "/dev/xvdh",
				"delete_on_termination": false,
				"volume_size": 10,
				"volume_type": "gp2",
				"tags": {
					"Name": "TeamCity-Data3",
					"zpool": "data",
					"Component": "TeamCity"
				}
			}
		]
	}],
	"provisioners": [
	{
		"type": "shell",
		"start_retry_timeout": "10m",
		"inline": [
			"DEBIAN_FRONTEND=noninteractive sudo apt-get update",
			"DEBIAN_FRONTEND=noninteractive sudo apt-get install -y zfs",
			"lsblk",
			"sudo parted /dev/xvdf --script mklabel GPT",
			"sudo parted /dev/xvdg --script mklabel GPT",
			"sudo parted /dev/xvdh --script mklabel GPT",
			"sudo zpool create -m none data raidz xvdf xvdg xvdh",
			"sudo zpool status",
			"sudo zpool export data",
			"sudo zpool status"
		]
	}
	]
}
```

StepModifyInstance and StepStopInstance are now shared between EBS and
EBS-Volume builders - move them into the AWS common directory and rename
them to indicate that they only apply to EBS-backed builders.
2016-11-02 12:56:39 -04:00
..
test-fixtures Updated test to verify expected behavior 2015-07-13 19:32:28 -07:00
build.go Improve -on-error descriptions 2016-09-18 03:00:36 +00:00
build_test.go Fix packer build reading from STDIN 2015-06-30 17:56:14 +00:00
command_test.go Updated test to verify expected behavior 2015-07-13 19:32:28 -07:00
fix.go Fixes #2667: Added vmware-rename to fix command help text 2015-08-24 20:19:49 +02:00
fix_test.go command/fix: validate resulting template [GH-2075] 2015-06-13 13:56:09 -04:00
inspect.go run gofmt 2016-11-01 14:08:04 -07:00
meta.go Don't override packer's build version from a config file; fixes #2385 2015-07-13 19:03:36 -07:00
plugin.go builder/amazon: Add ebs-volume builder 2016-11-02 12:56:39 -04:00
push.go add dot to build name regexp 2016-09-28 15:11:36 -07:00
push_test.go run gofmt 2016-11-01 14:08:04 -07:00
validate.go command/validate: bail if can't initialize build [GH-2139] 2015-05-29 16:09:37 -07:00
validate_test.go Updated test to verify expected behavior 2015-07-13 19:32:28 -07:00
version.go Remove generator from command/version because we can't go build ./... -- it also builds vendored stuff 2016-02-05 11:17:48 -08:00
version_test.go command: version tests 2014-10-27 20:58:44 -07:00