All provisioning scripts run on all builders, so that both parallels.sh and vmware.sh run on virtualbox-iso builder.
STEPS
Do a build with with -only option, e.g. packer build -only=vmware-iso.
EXPECTED RESULTS
Onlyvirtualbox.sh provisioning script would run.
The vmware.sh and parallels.sh scripts would NOT run.
ACTUAL RESULTS
All three vm platform specific provisioning scripts (parallels, vmware, virtualbox) would run on virtualbox.
POTENTIAL SOLUTIONS
Use {{.Provider}} in the name (haven't tried this):
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E -S bash '{{ .Path }}'",
"scripts": [
"script/{{.Provider}}.sh",
"script/xcode-cli-tools.sh",
"script/add-network-interface-detection.sh",
"script/energy.sh",
"script/autologin.sh",
"script/update.sh",
"script/update.sh",
"script/update.sh",
"script/update.sh"
],
}
Utilize the only key within a provisioners area:
{
"only": ["virtualbox-iso"],
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E -S bash '{{ .Path }}'",
"script": "scripts/virtualbox.sh"
}
All provisioning scripts run on all builders, so that both
parallels.shandvmware.shrun on virtualbox-iso builder.STEPS
Do a build with with
-onlyoption, e.g.packer build -only=vmware-iso.EXPECTED RESULTS
Only
virtualbox.shprovisioning script would run.The
vmware.shandparallels.shscripts would NOT run.ACTUAL RESULTS
All three vm platform specific provisioning scripts (parallels, vmware, virtualbox) would run on virtualbox.
POTENTIAL SOLUTIONS
Use
{{.Provider}}in the name (haven't tried this):Utilize the
onlykey within a provisioners area: