-
Notifications
You must be signed in to change notification settings - Fork 19
/
base.json
71 lines (69 loc) · 1.59 KB
/
base.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
{
"variables":{
"build":"",
"ami_profile":"",
"job_tag":"",
"software_version":"",
"hvm_amiid":"",
"date":"",
"security_group_id":"",
"subnet_id":"",
"region":"",
"vpc_id":"",
"instance_type":""
},
"builders":[
{
"name":"hvm_builder",
"ami_virtualization_type":"hvm",
"type": "amazon-ebs",
"source_ami": "{{user `hvm_amiid`}}",
"ssh_username": "ec2-user",
"associate_public_ip_address": "true",
"subnet_id":"{{user `subnet_id`}}",
"instance_type": "{{user `instance_type`}}",
"security_group_id":"{{user `security_group_id`}}",
"ssh_timeout":"5m",
"ssh_private_ip": "true",
"vpc_id":"{{user `vpc_id`}}",
"ami_name": "{{user `ami_profile`}}_build-{{user `build`}}_Source-{{user `hvm_amiid`}}_Built-{{user `date`}}",
"region":"{{user `region`}}",
"tags": {
"Name":"{{user `ami_profile`}}-{{user `build`}}",
"source":"{{user `hvm_amiid`}}",
"virtualization_type":"hvm",
"build":"{{user `build`}}",
"profile":"{{user `ami_profile`}}",
"creator":"packer",
"creation_time":"{{user `date`}}"
}
}
],
"provisioners":[
{"type":"shell",
"inline":[
"sleep 90"
]
},
{
"type":"shell",
"inline_shebang":"/bin/bash",
"inline":[
"sudo pip install ansible",
"mkdir -p /tmp/ansible-packer/roles",
"sudo chmod 777 /tmp/ansible-packer/roles"
]
},
{
"type": "file",
"source":"roles/",
"destination": "/tmp/ansible-packer/roles"
},
{
"type": "ansible-local",
"playbook_file": "{{user `ami_profile`}}.yml",
"group_vars": "group_vars",
"staging_directory":"/tmp/ansible-packer"
}
]
}