Skip to content

Commit 48738df

Browse files
eak12913yorinasub17
authored andcommitted
Added example packer template. Will add a test later, when time allows
1 parent 97c4713 commit 48738df

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"min_packer_version": "0.12.0",
3+
"variables": {
4+
"aws_region": "us-west-1",
5+
"github_auth_token": "{{env `GITHUB_OAUTH_TOKEN`}}"
6+
},
7+
"builders": [{
8+
"name": "elasticsearch-ami-ubuntu",
9+
"ami_name": "gruntwork-ubuntu-elasticsearch-example-{{uuid | clean_ami_name}}",
10+
"ami_description": "An Ubuntu AMI that has Elasticsearch installed.",
11+
"instance_type": "t2.micro",
12+
"region": "{{user `aws_region`}}",
13+
"type": "amazon-ebs",
14+
"source_ami_filter": {
15+
"filters": {
16+
"virtualization-type": "hvm",
17+
"architecture": "x86_64",
18+
"name": "*ubuntu-xenial-16.04-amd64-server-*",
19+
"block-device-mapping.volume-type": "gp2",
20+
"root-device-type": "ebs"
21+
},
22+
"owners": ["amazon"],
23+
"most_recent": true
24+
},
25+
"ssh_username": "ubuntu"
26+
}],
27+
"provisioners": [{
28+
"type": "shell",
29+
"inline": [
30+
"# Get around issue where automatic ubuntu updates prevent package installation.",
31+
"curl -Ls https://raw.githubusercontent.com/gruntwork-io/bash-commons/dynamic-ubuntu-waiter/modules/bash-commons/src/dynamic-ubuntu-wait.sh | bash",
32+
"sudo apt-get -y update"
33+
]
34+
},{
35+
"type": "shell",
36+
"inline": [
37+
"sudo apt-get install -y rolldice"
38+
]
39+
},{
40+
"type": "shell",
41+
"inline": [
42+
"sudo apt-get -y update",
43+
"sudo apt-get install -y nano"
44+
]
45+
}]
46+
}

0 commit comments

Comments
 (0)