-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.json
More file actions
184 lines (160 loc) · 6.54 KB
/
build.json
File metadata and controls
184 lines (160 loc) · 6.54 KB
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
{
"variables": {
"packer_cache_dir": "{{env `PACKER_CACHE_DIR`}}",
"target": "{{env `PACKER_TARGET`}}",
"base_version": "{{env `PACKER_BASE_VERSION`}}",
"arch": "{{env `PACKER_ARCH`}}",
"headless": "{{env `PACKER_HEADLESS`}}",
"target_version": "{{env `PACKER_TARGET_VERSION`}}",
"apt_sources": "{{env `PACKER_APT_SOURCES`}}",
"vm_type": "{{env `PACKER_VM_TYPE`}}",
"root_password": "123"
},
"builders": [
{
"name": "qemu-vm",
"type": "qemu",
"format": "qcow2",
"accelerator": "kvm",
"vm_name": "{{ user `vm_type` }}-{{ user `target` }}-{{ user `target_version` }}-{{ user `arch` }}",
"disk_size": 30000,
"disk_cache": "unsafe",
"disk_interface": "virtio-scsi",
"output_directory": "{{ user `vm_type` }}-{{ user `target` }}-{{ user `target_version` }}-{{ user `arch` }}",
"headless": "{{user `headless`}}",
"cpus": 1,
"memory": "{{ user `vm_mem` }}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_target_path": "{{user `packer_cache_dir`}}/{{ user `iso_target_path`}}",
"http_port_min": "{{user `http_port_min`}}",
"http_port_max": "{{user `http_port_max`}}",
"ssh_username": "{{ user `ssh_user` }}",
"ssh_password": "{{ user `ssh_pass` }}",
"ssh_wait_timeout": "60m",
"ssh_pty": true,
"http_directory": "./",
"boot_wait": "2s",
"boot_command": [
"<esc><wait><enter><wait>",
"{{ user `boot_cmd` }} ",
"ai curl=http://{{.HTTPIP}}:{{.HTTPPort}}/metadata/{{ user `metadata` }}/ ",
"<wait><enter>"
],
"shutdown_command": "sudo shutdown -P now"
},
{
"name": "onebula-vm",
"type": "qemu",
"accelerator": "kvm",
"vm_name": "{{ user `vm_type` }}-{{ user `target` }}-{{user `target_version`}}-{{user `arch`}}",
"disk_size": 30000,
"disk_cache": "unsafe",
"disk_interface": "virtio-scsi",
"output_directory": "{{ user `vm_type` }}-{{ user `target` }}-{{ user `target_version` }}-{{ user `arch` }}",
"headless": "{{user `headless`}}",
"cpus": 1,
"memory": "{{ user `vm_mem` }}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_target_path": "{{user `packer_cache_dir`}}/{{ user `iso_target_path`}}",
"http_port_min": "{{user `http_port_min`}}",
"http_port_max": "{{user `http_port_max`}}",
"ssh_username": "{{ user `ssh_user` }}",
"ssh_password": "{{ user `ssh_pass` }}",
"ssh_wait_timeout": "60m",
"ssh_pty": true,
"http_directory": "./",
"boot_wait": "2s",
"boot_command": [
"<esc><wait><enter><wait>",
"{{ user `boot_cmd` }} ",
"ai curl=http://{{.HTTPIP}}:{{.HTTPPort}}/metadata/{{ user `metadata` }}/ ",
"<wait><enter>"
],
"shutdown_command": "sudo shutdown -P now"
},
{
"name": "vbox-vm",
"type": "virtualbox-iso",
"guest_os_type": "Linux_64",
"vm_name": "{{ user `vm_type` }}-{{ user `target` }}-{{user `target_version`}}-{{user `arch`}}",
"disk_size": 30000,
"output_directory": "{{ user `vm_type` }}-{{ user `target` }}-{{user `target_version`}}-{{user `arch`}}",
"headless": "{{user `headless`}}",
"keep_registered": false,
"guest_additions_mode": "disable",
"cpus": 1,
"memory": "{{ user `vm_mem` }}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_target_path": "{{user `packer_cache_dir`}}/{{ user `iso_target_path`}}",
"http_port_min": "{{user `http_port_min`}}",
"http_port_max": "{{user `http_port_max`}}",
"ssh_username": "{{ user `vagrant_user` }}",
"ssh_password": "{{ user `vagrant_pass` }}",
"ssh_wait_timeout": "60m",
"ssh_pty": true,
"http_directory": "./",
"boot_wait": "5s",
"boot_command": [
"<esc><wait><enter><wait>",
"{{ user `boot_cmd` }} ",
"ai curl=http://{{.HTTPIP}}:{{.HTTPPort}}/metadata/{{ user `metadata` }}/ ",
"<wait><enter>"
],
"shutdown_command": "sudo shutdown -P now",
"post_shutdown_delay": "10s",
"export_opts":
[
"--manifest",
"--vsys", "0",
"--description", "{{ user `descr` }}",
"--version", "{{ user `image_version` }}"
],
"format": "ova"
}
],
"provisioners": [
{
"type": "file",
"source": "scripts/",
"destination": "/tmp/"
},
{
"type": "shell",
"script": "scripts/vm_setup",
"environment_vars": [
"ROOT_PASS={{ user `root_password` }}",
"PASS='{{ user `ssh_pass` }}'",
"SSH_USER='{{ user `ssh_user` }}'",
"VM_TYPE={{ user `vm_type` }}",
"TARGET={{ user `target` }}",
"TARGET_REPOS={{ user `target_version` }}",
"ARCH={{ user `arch` }}",
"CLOUDINIT={{ user `with_cloudinit` }}",
"SISYPHUS={{ user `with_sisyphus` }}"
]
}
],
"post-processors": [
{
"type": "checksum",
"checksum_types": [ "md5", "sha1" ],
"output": "results/{{ user `vm_type` }}-{{ user `target` }}-{{ user `target_version` }}-{{ user `arch` }}.{{.ChecksumType}}"
},
{
"type": "vagrant",
"output": "results/{{ user `vm_type` }}-{{ user `target` }}-{{ user `target_version` }}-{{ user `arch` }}.box",
"only": [ "qemu-vm", "vbox-vm" ]
},
{
"type": "manifest",
"output": "results/manifest.json",
"strip_path": true
}
]
}