-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer.json
51 lines (51 loc) · 1.37 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
{
"variables": {
"changes": "{{ env `CHANGES` }}",
"gitinfo": "{{ env `GITINFO` }}",
"branch": "{{ env `BRANCH` }}"
},
"builders": [
{
"type": "amazon-ebs",
"name": "empire-us-east-1",
"access_key": "",
"secret_key": "",
"region": "us-east-1",
"source_ami": "ami-c135f3aa",
"instance_type": "m3.medium",
"ssh_username": "ubuntu",
"ssh_timeout": "5m",
"ami_name": "Empire PaaS {{user `branch` | clean_ami_name}} {{isotime | clean_ami_name}}",
"ami_regions": ["us-west-1", "us-west-2"],
"tags": {
"changes": "{{user `changes`}}",
"gitinfo": "{{user `gitinfo`}}"
}
}
],
"provisioners": [
{
"type": "file",
"source": "files",
"destination": "/tmp/packer_files"
},
{
"type": "file",
"source": "ansible",
"destination": "/tmp/ansible"
},
{
"type": "shell",
"pause_before": "60s",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo {{ .Path }}",
"script": "files/setup.sh"
},
{
"type": "ansible-local",
"command": "chmod +x /tmp/packer-provisioner-ansible-local/hosts; EMPIRE_HOSTGROUP=empire_ami sudo -E ansible-playbook --tags build_ami ",
"playbook_file": "./ansible/site.yml",
"inventory_file": "files/hosts",
"playbook_dir": "./ansible"
}
]
}