forked from mozilla-iam/packer-gold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer.json
64 lines (64 loc) · 1.83 KB
/
packer.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"aws_security_token": "{{env `AWS_SECURITY_TOKEN`}}"
},
"builders": [{
"type": "amazon-ebs",
"region": "us-west-2",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"token": "{{user `aws_security_token`}}",
"source_ami": "ami-f173cc91",
"instance_type": "t2.medium",
"ssh_pty" : "true",
"ssh_username": "ec2-user",
"ami_name": "mozilla_iam_gold_{{timestamp}}"
}],
"provisioners": [
{ "type": "shell",
"inline": [
"sleep 30",
"sudo yum update -y",
"sudo yum install epel-release -y",
"sudo yum install @development -y",
"sudo yum install python-pip -y",
"sudo yum install python-setuptools -y",
"sudo yum install -y wget zlib-dev openssl-devel sqlite-devel bzip2-devel python-devel",
"sudo pip install ansible"
]},
{
"type": "ansible-local",
"playbook_file": "./playbook.yml"
},
{
"type": "file",
"source": "./files/tags-to-env.sh",
"destination": "/home/ec2-user/tags_to_env.sh"
},
{ "type": "shell",
"inline": [
"sudo mv /home/ec2-user/tags_to_env.sh /usr/local/bin/",
"sudo chmod 775 /usr/local/bin/tags_to_env.sh"
]
},
{
"type": "file",
"source": "./files/supervisord",
"destination": "/home/ec2-user/supervisord"
},
{
"type": "file",
"source": "./files/supervisord.conf",
"destination": "/home/ec2-user/supervisord.conf"
},
{ "type": "shell",
"inline": [
"sudo mv /home/ec2-user/supervisord /etc/init.d/supervisord",
"sudo chmod a+x /etc/init.d/supervisord",
"sudo mv /home/ec2-user/supervisord.conf /etc/supervisord.conf"
]
}
]
}