Skip to content

Commit fd411ab

Browse files
mpywelllbajolet-hashicorp
authored andcommitted
iso: reintroduce iso config struct for boot iso
- to reduce impact on packer configs of previous versions, revert to additional_iso_files map naming - the boot iso is now a config item under the iso builder and prepended to common's ISOs slice for enumeration
1 parent 10f7a57 commit fd411ab

File tree

16 files changed

+219
-228
lines changed

16 files changed

+219
-228
lines changed

.web-docs/components/builder/clone/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ boot time.
271271
- `cloud_init_disk_type` (string) - The type of Cloud-Init disk. Can be `scsi`, `sata`, or `ide`
272272
Defaults to `ide`.
273273

274-
- `isos` ([]ISOsConfig) - ISO files attached to the virtual machine.
275-
See [ISO Files](#iso-files).
274+
- `additional_iso_files` ([]ISOsConfig) - ISO files attached to the virtual machine.
275+
See [ISOs](#isos).
276276

277277
- `vm_interface` (string) - Name of the network interface that Packer gets
278278
the VMs IP from. Defaults to the first non loopback interface.
@@ -502,13 +502,13 @@ Usage example (JSON):
502502

503503
<!-- Code generated from the comments of the ISOsConfig struct in builder/proxmox/common/config.go; DO NOT EDIT MANUALLY -->
504504

505-
One or more ISO files attached to the virtual machine.
505+
ISO files attached to the virtual machine.
506506

507507
JSON Example:
508508

509509
```json
510510

511-
"isos": [
511+
"additional_iso_files": [
512512
{
513513
"type": "scsi",
514514
"iso_file": "local:iso/virtio-win-0.1.185.iso",
@@ -522,7 +522,7 @@ HCL2 example:
522522

523523
```hcl
524524
525-
isos {
525+
additional_iso_files {
526526
type = "scsi"
527527
iso_file = "local:iso/virtio-win-0.1.185.iso"
528528
unmount = true
@@ -677,7 +677,7 @@ In HCL2:
677677
`local:iso/Fedora-Server-dvd-x86_64-29-1.2.iso`.
678678
Either `iso_file` OR `iso_url` must be specifed.
679679

680-
- `storage_pool` (string) - Proxmox storage pool onto which to upload
680+
- `iso_storage_pool` (string) - Proxmox storage pool onto which to upload
681681
the ISO file.
682682

683683
- `iso_download_pve` (bool) - Download the ISO directly from the PVE node rather than through Packer.

.web-docs/components/builder/iso/README.md

Lines changed: 39 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -35,70 +35,38 @@ in the image's Cloud-Init settings for provisioning.
3535

3636
### Required:
3737

38-
<!-- Code generated from the comments of the ISOsConfig struct in builder/proxmox/common/config.go; DO NOT EDIT MANUALLY -->
39-
40-
One or more ISO files attached to the virtual machine.
41-
42-
JSON Example:
43-
44-
```json
45-
46-
"isos": [
47-
{
48-
"type": "scsi",
49-
"iso_file": "local:iso/virtio-win-0.1.185.iso",
50-
"unmount": true,
51-
"iso_checksum": "af2b3cc9fa7905dea5e58d31508d75bba717c2b0d5553962658a47aebc9cc386"
52-
}
53-
]
54-
55-
```
56-
HCL2 example:
57-
58-
```hcl
59-
60-
isos {
61-
type = "scsi"
62-
iso_file = "local:iso/virtio-win-0.1.185.iso"
63-
unmount = true
64-
iso_checksum = "af2b3cc9fa7905dea5e58d31508d75bba717c2b0d5553962658a47aebc9cc386"
65-
}
66-
67-
```
68-
69-
<!-- End of code generated from the comments of the ISOsConfig struct in builder/proxmox/common/config.go; -->
70-
71-
72-
<!-- Code generated from the comments of the ISOConfig struct in multistep/commonsteps/iso_config.go; DO NOT EDIT MANUALLY -->
73-
74-
- `iso_checksum` (string) - The checksum for the ISO file or virtual hard drive file. The type of
75-
the checksum is specified within the checksum field as a prefix, ex:
76-
"md5:{$checksum}". The type of the checksum can also be omitted and
77-
Packer will try to infer it based on string length. Valid values are
78-
"none", "{$checksum}", "md5:{$checksum}", "sha1:{$checksum}",
79-
"sha256:{$checksum}", "sha512:{$checksum}" or "file:{$path}". Here is a
80-
list of valid checksum values:
81-
* md5:090992ba9fd140077b0661cb75f7ce13
82-
* 090992ba9fd140077b0661cb75f7ce13
83-
* sha1:ebfb681885ddf1234c18094a45bbeafd91467911
84-
* ebfb681885ddf1234c18094a45bbeafd91467911
85-
* sha256:ed363350696a726b7932db864dda019bd2017365c9e299627830f06954643f93
86-
* ed363350696a726b7932db864dda019bd2017365c9e299627830f06954643f93
87-
* file:http://releases.ubuntu.com/20.04/SHA256SUMS
88-
* file:file://./local/path/file.sum
89-
* file:./local/path/file.sum
90-
* none
91-
Although the checksum will not be verified when it is set to "none",
92-
this is not recommended since these files can be very large and
93-
corruption does happen from time to time.
94-
95-
- `iso_url` (string) - A URL to the ISO containing the installation image or virtual hard drive
96-
(VHD or VHDX) file to clone.
38+
<!-- Code generated from the comments of the Config struct in builder/proxmox/iso/config.go; DO NOT EDIT MANUALLY -->
9739

98-
<!-- End of code generated from the comments of the ISOConfig struct in multistep/commonsteps/iso_config.go; -->
40+
- `iso` (common.ISOsConfig) - Boot ISO attached to the virtual machine.
41+
42+
JSON Example:
43+
44+
```json
45+
46+
"iso": {
47+
"type": "scsi",
48+
"iso_file": "local:iso/debian-12.5.0-amd64-netinst.iso",
49+
"unmount": true,
50+
"iso_checksum": "sha512:33c08e56c83d13007e4a5511b9bf2c4926c4aa12fd5dd56d493c0653aecbab380988c5bf1671dbaea75c582827797d98c4a611f7fb2b131fbde2c677d5258ec9"
51+
}
52+
53+
```
54+
HCL2 example:
55+
56+
```hcl
57+
58+
iso {
59+
type = "scsi"
60+
iso_file = "local:iso/debian-12.5.0-amd64-netinst.iso"
61+
unmount = true
62+
iso_checksum = "sha512:33c08e56c83d13007e4a5511b9bf2c4926c4aa12fd5dd56d493c0653aecbab380988c5bf1671dbaea75c582827797d98c4a611f7fb2b131fbde2c677d5258ec9"
63+
}
64+
65+
```
66+
See [ISOs](#isos) for additional options.
9967

68+
<!-- End of code generated from the comments of the Config struct in builder/proxmox/iso/config.go; -->
10069

101-
See also [ISO Files](#iso-files).
10270

10371
### Optional:
10472

@@ -238,8 +206,8 @@ See also [ISO Files](#iso-files).
238206
- `cloud_init_disk_type` (string) - The type of Cloud-Init disk. Can be `scsi`, `sata`, or `ide`
239207
Defaults to `ide`.
240208

241-
- `isos` ([]ISOsConfig) - ISO files attached to the virtual machine.
242-
See [ISO Files](#iso-files).
209+
- `additional_iso_files` ([]ISOsConfig) - ISO files attached to the virtual machine.
210+
See [ISOs](#isos).
243211

244212
- `vm_interface` (string) - Name of the network interface that Packer gets
245213
the VMs IP from. Defaults to the first non loopback interface.
@@ -274,17 +242,17 @@ See also [ISO Files](#iso-files).
274242
<!-- End of code generated from the comments of the ISOConfig struct in multistep/commonsteps/iso_config.go; -->
275243

276244

277-
### ISO Files
245+
### ISOs
278246

279247
<!-- Code generated from the comments of the ISOsConfig struct in builder/proxmox/common/config.go; DO NOT EDIT MANUALLY -->
280248

281-
One or more ISO files attached to the virtual machine.
249+
ISO files attached to the virtual machine.
282250

283251
JSON Example:
284252

285253
```json
286254

287-
"isos": [
255+
"additional_iso_files": [
288256
{
289257
"type": "scsi",
290258
"iso_file": "local:iso/virtio-win-0.1.185.iso",
@@ -298,7 +266,7 @@ HCL2 example:
298266

299267
```hcl
300268
301-
isos {
269+
additional_iso_files {
302270
type = "scsi"
303271
iso_file = "local:iso/virtio-win-0.1.185.iso"
304272
unmount = true
@@ -310,87 +278,6 @@ HCL2 example:
310278
<!-- End of code generated from the comments of the ISOsConfig struct in builder/proxmox/common/config.go; -->
311279

312280

313-
<!-- Code generated from the comments of the ISOConfig struct in multistep/commonsteps/iso_config.go; DO NOT EDIT MANUALLY -->
314-
315-
By default, Packer will symlink, download or copy image files to the Packer
316-
cache into a "`hash($iso_url+$iso_checksum).$iso_target_extension`" file.
317-
Packer uses [hashicorp/go-getter](https://github.com/hashicorp/go-getter) in
318-
file mode in order to perform a download.
319-
320-
go-getter supports the following protocols:
321-
322-
* Local files
323-
* Git
324-
* Mercurial
325-
* HTTP
326-
* Amazon S3
327-
328-
Examples:
329-
go-getter can guess the checksum type based on `iso_checksum` length, and it is
330-
also possible to specify the checksum type.
331-
332-
In JSON:
333-
334-
```json
335-
336-
"iso_checksum": "946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2",
337-
"iso_url": "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso"
338-
339-
```
340-
341-
```json
342-
343-
"iso_checksum": "file:ubuntu.org/..../ubuntu-14.04.1-server-amd64.iso.sum",
344-
"iso_url": "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso"
345-
346-
```
347-
348-
```json
349-
350-
"iso_checksum": "file://./shasums.txt",
351-
"iso_url": "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso"
352-
353-
```
354-
355-
```json
356-
357-
"iso_checksum": "file:./shasums.txt",
358-
"iso_url": "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso"
359-
360-
```
361-
362-
In HCL2:
363-
364-
```hcl
365-
366-
iso_checksum = "946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2"
367-
iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso"
368-
369-
```
370-
371-
```hcl
372-
373-
iso_checksum = "file:ubuntu.org/..../ubuntu-14.04.1-server-amd64.iso.sum"
374-
iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso"
375-
376-
```
377-
378-
```hcl
379-
380-
iso_checksum = "file://./shasums.txt"
381-
iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso"
382-
383-
```
384-
385-
```hcl
386-
387-
iso_checksum = "file:./shasums.txt",
388-
iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso"
389-
390-
```
391-
392-
<!-- End of code generated from the comments of the ISOConfig struct in multistep/commonsteps/iso_config.go; -->
393-
394281

395282
#### Required
396283

@@ -453,7 +340,7 @@ In HCL2:
453340
`local:iso/Fedora-Server-dvd-x86_64-29-1.2.iso`.
454341
Either `iso_file` OR `iso_url` must be specifed.
455342

456-
- `storage_pool` (string) - Proxmox storage pool onto which to upload
343+
- `iso_storage_pool` (string) - Proxmox storage pool onto which to upload
457344
the ISO file.
458345

459346
- `iso_download_pve` (bool) - Download the ISO directly from the PVE node rather than through Packer.
@@ -1168,7 +1055,7 @@ source "proxmox-iso" "fedora-kickstart" {
11681055
}
11691056
http_directory = "config"
11701057
insecure_skip_tls_verify = true
1171-
isos {
1058+
iso {
11721059
iso_file = "local:iso/Fedora-Server-dvd-x86_64-29-1.2.iso"
11731060
}
11741061
network_adapters {
@@ -1225,11 +1112,9 @@ build {
12251112
"pre_enrolled_keys": true,
12261113
"efi_type": "4m"
12271114
},
1228-
"isos": [
1229-
{
1115+
"iso": {
12301116
"iso_file": "local:iso/Fedora-Server-dvd-x86_64-29-1.2.iso"
1231-
}
1232-
],
1117+
},
12331118
"http_directory": "config",
12341119
"boot_wait": "10s",
12351120
"boot_command": [

builder/proxmox/clone/config.hcl2spec.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)