This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpacker.json
74 lines (74 loc) · 2.35 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
65
66
67
68
69
70
71
72
73
74
{
"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-bf4193c7",
"instance_type": "t2.large",
"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",
"sudo yum install ruby -y",
"sudo pip install boto3 --upgrade",
"sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_386/amazon-ssm-agent.rpm",
"sudo wget https://d1wk0tztpsntt1.cloudfront.net/linux/latest/install",
"sudo bash install",
"sudo rm install",
"wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install",
"sudo chmod +x ./install",
"sudo ./install auto",
"ssh-keyscan github.com >> /home/ec2-user/.ssh/known_hosts"
]},
{
"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"
]
}
]
}