-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-ubuntu.json
251 lines (251 loc) · 8.49 KB
/
template-ubuntu.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
{
"variables": {
"ansible_galaxy_file": "",
"ansible_playbook_dir": "",
"ansible_playbook_file": "playbook.yaml",
"ansible_version": "",
"aws_ami_regions": "us-east-1",
"aws_image_name": "packer-ubuntu",
"aws_instance_type": "t2.micro",
"aws_region": "us-east-1",
"aws_ssh_username": "ubuntu",
"build_timestamp": "{{timestamp}}",
"disk_size": "40520",
"memory": "4096",
"virtualbox_artifact_description": "",
"virtualbox_artifact_version": "",
"virtualbox_guest_os_type": "ubuntu-64",
"vm_name": "senzing-packer-ubuntu",
"vmware_guest_os_type": "ubuntu-64",
"vmware_vmdk_name": "senzing-packer-ubuntu"
},
"builders": [
{
"access_key": "{{user `aws_access_key`}}",
"ami_description": "Build time: {{isotime \"2006-01-02_03:04:05\"}}",
"ami_name": "{{user `aws_image_name`}}-{{user `build_timestamp`}}",
"ami_regions": "{{user `aws_ami_regions`}}",
"ami_virtualization_type": "hvm",
"associate_public_ip_address": true,
"instance_type": "{{user `aws_instance_type`}}",
"region": "{{user `aws_region`}}",
"secret_key": "{{user `aws_secret_key`}}",
"source_ami": "{{user `aws_source_ami`}}",
"ssh_keypair_name": "{{user `aws_ssh_keypair_name`}}",
"ssh_private_key_file": "{{user `aws_ssh_private_key_file`}}",
"ssh_username": "{{user `aws_ssh_username`}}",
"subnet_id": "{{user `aws_subnet_id`}}",
"type": "amazon-ebs",
"vpc_id": "{{user `aws_vpc_id`}}"
},
{
"boot_command": [
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US<wait>",
" fb=false<wait>",
" initrd=/install/initrd.gz<wait>",
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
" locale=en_US<wait>",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=vagrant<wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" noapic<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-ubuntu.cfg",
" -- <wait>",
"<enter><wait>"
],
"boot_wait": "10s",
"disk_size": "{{user `disk_size`}}",
"export_opts": [
"--manifest",
"--vsys",
"0",
"--description",
"{{user `virtualbox_artifact_description`}}",
"--version",
"{{user `virtualbox_artifact_version`}}"
],
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "{{user `virtualbox_guest_os_type`}}",
"headless": false,
"http_directory": "http",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `iso_url`}}",
"memory": "{{user `memory`}}",
"output_directory": "output-virtualbox-iso-{{user `build_timestamp`}}",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "2h",
"ssh_username": "vagrant",
"type": "virtualbox-iso",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"8096"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
],
[
"modifyvm",
"{{.Name}}",
"--vram",
"12"
],
[
"modifyvm",
"{{.Name}}",
"--natpf1",
"SSH,tcp,127.0.0.1,2222,,22"
],
[
"modifyvm",
"{{.Name}}",
"--natpf1",
"pgAdmin4,tcp,127.0.0.1,5051,,5051"
],
[
"modifyvm",
"{{.Name}}",
"--natpf1",
"phppgadmin,tcp,127.0.0.1,5052,,5052"
],
[
"modifyvm",
"{{.Name}}",
"--natpf1",
"entity-search-web-app,tcp,127.0.0.1,8081,,8081"
],
[
"modifyvm",
"{{.Name}}",
"--natpf1",
"jupyter-notebook,tcp,127.0.0.1,8888,,8888"
]
],
"virtualbox_version_file": ".vbox_version",
"vm_name": "{{user `vm_name`}}-{{user `build_timestamp`}}"
},
{
"boot_command": [
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US<wait>",
" fb=false<wait>",
" initrd=/install/initrd.gz<wait>",
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
" locale=en_US<wait>",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=vagrant<wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" noapic<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-ubuntu.cfg",
" -- <wait>",
"<enter><wait>"
],
"boot_wait": "10s",
"disk_size": "{{user `disk_size`}}",
"guest_os_type": "{{user `vmware_guest_os_type`}}",
"headless": false,
"http_directory": "http",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `iso_url`}}",
"output_directory": "output-vmware-iso-{{user `build_timestamp`}}",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "2h",
"ssh_username": "vagrant",
"tools_upload_flavor": "linux",
"type": "vmware-iso",
"vm_name": "{{user `vm_name`}}-{{user `build_timestamp`}}",
"vmdk_name": "{{user `vmware_vmdk_name`}}-{{user `build_timestamp`}}",
"vmx_data": {
"cpuid.coresPerSocket": "1"
}
},
{
"type": "googlecompute",
"project_id": "{{user `gcp_project_id`}}",
"source_image": "{{user `gcp_source_image`}}",
"zone": "{{user `gcp_zone`}}",
"image_name": "{{user `vm_name`}}-{{user `build_timestamp`}}",
"machine_type": "{{user `gcp_machine_type`}}",
"ssh_username": "{{user `gcp_ssh_username`}}"
},
{
"type": "null"
}
],
"post-processors": [
{
"keep_input_artifact": true,
"override": {
"aws": {
"output": "{{user `aws_image_name`}}-aws-{{user `build_timestamp`}}.box"
},
"virtualbox": {
"output": "{{user `vm_name`}}-virtualbox-{{user `build_timestamp`}}.box"
},
"vmware": {
"output": "{{user `vm_name`}}-vmware-{{user `build_timestamp`}}.box"
}
},
"type": "vagrant"
}
],
"provisioners": [
{
"environment_vars": [
"ANSIBLE_VERSION={{user `ansible_version`}}"
],
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}' '{{user `ansible_install`}}'",
"script": "scripts/ansible-ubuntu.sh",
"type": "shell"
},
{
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/setup-ubuntu.sh",
"type": "shell"
},
{
"galaxy_file": "{{user `ansible_galaxy_file`}}",
"playbook_dir": "{{user `ansible_playbook_dir`}}",
"playbook_file": "{{user `ansible_playbook_file`}}",
"only": ["${ANSIBLE_ROLE}"],
"type": "ansible-local"
},
{
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}' '{{user `ansible_cleanup`}}'",
"script": "scripts/cleanup-ubuntu.sh",
"type": "shell"
}
]
}