I would like to pass ISO_URL as a command line parameter. I tried to follow an example at https://www.packer.io/docs/templates/user-variables.html
Where my variable section looks like
"variables": {
"build_version": "1.0.0",
"iso_checksum_type":"md5",
"iso_checksum":"453312bf56fc45669fec5ebc0f025ac7",
"iso_url":"c:\fake.iso"
}
the variable references
...
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type":"{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
...
and the build command is
packer build -var 'iso_url=c:\debian.iso' packerio.json
However, the iso_url is not overwritten and packer is trying to download the fake.iso
Why?
The exact result is
virtualbox-iso output will be in this color.
==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///C:/Program%20Files/Oracle/VirtualBox/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: file:///c:/fake.iso
virtualbox-iso: Error downloading: GetFileAttributesEx c:/fake.iso: The system cannot find the file specified.
==> virtualbox-iso: ISO download failed.
Build 'virtualbox-iso' errored: ISO download failed.
==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: ISO download failed.
==> Builds finished but no artifacts were created.