-
Notifications
You must be signed in to change notification settings - Fork 24
/
packer.json
60 lines (58 loc) · 1.61 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
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"sha": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-cc3b3ea4",
"instance_type": "m3.medium",
"ssh_username": "ubuntu",
"ssh_timeout": "5m",
"ami_groups": "all",
"ami_name": "Conveyor {{user `sha`}}",
"ami_block_device_mappings": [
{ "device_name": "/dev/xvdh", "volume_type": "io1", "iops": 1000, "volume_size": 50, "delete_on_termination": true }
],
"ami_regions": ["us-west-1", "us-west-2"],
"launch_block_device_mappings": [
{ "device_name": "/dev/xvdh", "volume_type": "io1", "iops": 1000, "volume_size": 50, "delete_on_termination": true }
],
"tags": {
"sha": "{{user `sha`}}"
}
}],
"provisioners": [{
"type": "shell",
"pause_before": "60s",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo {{ .Path }}",
"script": "./bin/install_ansible"
},{
"type": "shell",
"inline": [
"sudo sh -c \"echo '127.0.0.1 ansible_connection=local' > /etc/ansible/hosts\"",
"sudo mkdir -p /etc/ansible/playbook",
"sudo chown -R ubuntu:ubuntu /etc/ansible"
]
},{
"type": "file",
"source": "./roles",
"destination": "/etc/ansible"
},{
"type": "file",
"source": "site.yml",
"destination": "/etc/ansible/playbook/site.yml"
},{
"type": "shell",
"inline": [
"sudo ls -la /etc/ansible/playbook"
]
},{
"type": "shell",
"script": "./bin/ansible"
}]
}