-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.json
39 lines (38 loc) · 1010 Bytes
/
nginx.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
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "eu-west-1",
"source_ami": "ami-b0ac25c3",
"instance_type": "t2.nano",
"ssh_username": "ec2-user",
"ami_name": "packer_nginx {{timestamp}}",
"tags": {
"Name": "packer-nginx"
},
"ami_description": "nginx built by packer on {{isotime \"2006-01-02_03_04_05\"}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo sed -i -e '/\\[epel\\]/,/^$/s/enabled=0/enabled=1/' /etc/yum.repos.d/epel.repo",
"sudo yum update -y",
"sudo yum install -y ansible",
"sudo pip install ansible"
]
},
{
"type": "ansible-local",
"playbook_file": "./nginx.yml",
"command": "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 sudo ansible-playbook"
}
]
}