Commit Graph

20 Commits

Author SHA1 Message Date
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
Matthew Hooker 01be917450 Merge pull request #3660 from StackPointCloud/packer-builder-profitbricks
Packer Builder ProfitBricks
2016-10-31 15:45:24 -07:00
Sander van Harmelen dbf3bf56d4 Add a CloudStack Builder 2016-10-16 15:29:18 +02:00
Matthew Hooker a8e57d83d2 gofmt project.
noticed many unrelated changes being added to patches because of gofmt.

ran `find . -not -path "./vendor/*" -name "*.go" -exec gofmt -w {} \;`
2016-09-29 14:13:06 -07:00
jasminSPC d84b3af863 Fixed tests 2016-08-31 14:11:10 +02:00
Scott Crunkleton d2e65e6433 Generated command/plugin.go using scripts/generate-plugins.go. 2016-08-15 14:36:26 -07:00
crunk1 55b5a45ae4 Created googlecompute-export post-processor. Modified the googlecompute builder to pass a few configuration values to its resulting artifact. These values can then be used in googlecompute-export post-processor.
Added documentation and changed authentication stuff on temporary VM.
2016-08-15 14:36:26 -07:00
Chris Bednarski db593a517d Added manifest post-processor, which creates a manifest of build artifacts 2016-06-10 15:57:01 -07:00
Vasiliy Tolstov d64603e137 initial import of checksum post-processor (#3492)
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-05-18 17:31:16 -07:00
Chris Bednarski 5b5888b230 Initial import of Microsoft contributed code 2016-03-14 20:08:35 -07:00
Chris Bednarski 53176f8cdb Added amazon s3 service to vendor, to support the amazon-import feature 2016-02-12 10:41:26 -08:00
Chris Bednarski 58ebd6a9fd Merge branch 'deps' 2016-02-05 14:22:00 -08:00
Chris Bednarski 93547ad91c Regenerate command/plugin and apply go fmt (now handled by the makefile) 2016-02-05 11:18:36 -08:00
Marat Bakeev c95b2b483f Merge branch ansible-provisioner of https://github.com/dkhenry/packer 2016-02-05 15:40:17 +13:00
Chris Bednarski 6783bc3fb0 Added generator for command/plugin.go so we don't have to edit it by hand to add new plugins 2015-10-21 16:57:38 -07:00
Chris Bednarski bfe5b5b4b6 Change if/else logic to switch 2015-10-21 16:57:38 -07:00
Chris Bednarski 1641a5e0cb Replace string splitting with a regexp; this is clearer and less code because of the post-processor case 2015-10-21 16:57:38 -07:00
Chris Bednarski e080e73b04 Add some exit codes and use a constant for -PACKERSPACE- 2015-10-21 16:57:38 -07:00
Chris Bednarski 9fa93712a1 Added integrated post-processors 2015-10-21 16:57:38 -07:00
Chris Bednarski d09a9ab0c7 Implemented internal plugins
- Internal plugins are compiled into the same packer binary and invoked through the plugin command
- Search paths allow disk-based plugins to override and should function as normal
- This should allow for a 94% space savings vs statically compiling all the plugins as separate binaries.. approximately 24mb vs 431mb
2015-10-21 16:57:38 -07:00