Running into an issue: the provisioner section seems never be executed. Here is the json file:
"builders": [
{
"type": "vsphere-iso",
"username": "admini...@vsphere.local",
"password": "XXXXXXXXXXXXX",
"insecure_connection": "true",
"vm_name": "photon3-ga-1",
"notes": "Build via Packer",
"cluster": "VxRail-Virtual-SAN-Cluster-XXXXX",
"datastore": "VxRail-Virtual-SAN-Datastore-XXXXX",
"folder": "MY VMs",
"guest_os_type": "vmwarePhoton64Guest",
"ssh_username": "sshuser",
"ssh_password": "XXXXXX",
"CPUs": 2,
"RAM": 4096,
"RAM_reserve_all": false,
"network": "Management Network-XXXXX",
"convert_to_template": false,
"disk_controller_type": "pvscsi",
"disk_size": 25000,
"disk_thin_provisioned": true,
"network_card": "vmxnet3",
"shutdown_command": "",
"iso_paths": ["[VxRail-Virtual-SAN-Datastore-XXXXX] iso/photon-os-3.0-ga/photon-3.0-58f9c74-bundle.iso"],
"floppy_files": [
"{{user `ks_path`}}/photon_ks.cfg"
],
"boot_command": ["<esc><wait>",
"vmlinuz initrd=initrd.img root=/dev/ram0 loglevel=3 ks=cdrom:/isolinux/photon_ks.cfg photon.media=cdrom",
"<enter>"]
}
],
"provisioners": [
{
"type": "shell",
"inline": ["mkdir -p /tmp/threetimes"],
"only": ["vsphere-iso"]
}
]
}
All I am doing is to create a dummy directory under /tmp. With or without "only": ["vsphere-iso"] is the same result - no directory is created. Anything wrong here?