-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer.json
49 lines (49 loc) · 1.27 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
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{ user `aws_access_key` }}",
"secret_key": "{{ user `aws_secret_key` }}",
"region": "us-east-1",
"instance_type": "t2.micro",
"source_ami": "ami-2ef48339",
"ssh_username": "ubuntu",
"ami_name": "docker-image-builder-{{ isotime \"2006-01-02-150405\" }}",
"ami_description": "Docker image builder AMI - {{ isotime \"2006-01-02-150405\" }} - built with Packer",
"tags": {
"Name": "Docker image builder AMI - {{ isotime \"2006-01-02-150405\" }} - built with Packer"
}
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo apt-get update",
"sudo apt-get install -y python-pip python-dev libssl-dev",
"export LC_ALL=C",
"sudo pip install pip --upgrade",
"sudo pip install ansible --upgrade"
]
},
{
"type": "ansible-local",
"playbook_file": "playbook.yml",
"inventory_file": "hosts",
"extra_arguments": [
"--limit localhost"
],
"playbook_dir": "roles/"
},
{
"type": "shell",
"inline": [
"sudo pip uninstall --yes ansible"
]
}
]
}