Run packer build:
$ packer build -var-file variables.json -on-error=ask -force ansible-packer.json
ansible-packer.json:
"skip_export": "false",
"output_directory": "output/live-server",
will save the OVF package locally (in the output folder) when packer has finished the job.
variables.json contains ESXi connection params:
{
"esxi_host": "<your esxi ip>",
"esxi_datastore": "datastore",
"esxi_username": "root",
"esxi_password": "<your password>"
}
For more info: https://imagineer.in/blog/packer-build-for-ubuntu-20-04/