Hi Jon,
Try out these steps
variables.json
==============
{
"esxi_host": "xxx.xxx.xxx.xxx",
"esxi_username": "root",
"esxi_password": "PassWordGoesHere"
}
runESXiCommands.json
===================
{
"builders": [{
"type": "null",
"name": "BUILDER-EXEC-ESXI-CMD",
"ssh_host": "{{user `esxi_host`}}",
"ssh_username": "{{user `esxi_username`}}",
"ssh_password": "{{user `esxi_password`}}"
}],
"provisioners": [{
"type": "shell",
"only": ["BUILDER-EXEC-ESXI-CMD"],
"scripts": [
"runESXiCommands.sh"
]
}
]
}
runESXiCommands.sh << This script will be executed on ESXi and make sure that SSH is Open on ESXi >>
==================
#!/bin/sh
vim-cmd vmsvc/convert.toTemplate
packer validate -var-file=variables.json runESXiCommands.json
packer build -only=BUILDER-EXEC-ESXI-CMD -var-file=.variables.json runESXiCommands.json
Regards,