I have a builder running on a vmware ESXi remote server:-
"builders": [
{
"type": "vmware-iso",
"vmx_template_path": "packer.vmx",
"guest_os_type": "ubuntu-64",
"remote_type": "esx5",
"remote_username": "vmbuildadmin",
"remote_host": "{{ user `vmware_host` }}",
"remote_private_key_file": "{{ user `vm_private_key` }}",
"remote_datastore": "{{ user `vm_datastore` }}",
"remote_password": "{{ user `vm_pass` }}",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "md5",
"vnc_port_min": 5970,
"vnc_port_max": 5990,
"ssh_username": "{{user `packer_username`}}",
"ssh_password": "{{user `packer_password`}}",
"ssh_timeout": "60m",
"shutdown_command": "echo '{{user `packer_username`}}' | sudo -S shutdown -P now",
"http_directory": "data/",
"headless": false,
"version": 8,
"tools_upload_flavor": "linux",
"format": "ovf",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz ",
" auto",
" console-setup/ask_detect=false",
" console-setup/layoutcode=us",
" console-setup/modelcode=pc105",
" debconf/frontend=noninteractive",
" debian-installer=en_US",
" fb=false",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
" initrd=/install/initrd.gz",
" kbd-chooser/method=us",
" keyboard-configuration/layout=USA",
" keyboard-configuration/variant=USA",
" hostname={{ .Name }} ",
" locale=en_US",
" netcfg/get_domain=vm",
" netcfg/get_hostname={{ .Name }}",
" noapic",
" -- ",
"<enter><wait>"
]
},
This builds images fine, the bit that fails is the ovftool conversion of ovf at the end of the build. This seems to be because the remote_password field is not getting filled in correctly to the command that's being called at export time.
I want to source the variable vm_pass from the command line so it can be prompted for in a wrapper script with the option : -var 'vm_pass=${vm_password}'
If I do this it simply gets filled with a blank, however if I specify a vm_pass variable in the variables section of the template it works.
I feel I must be missing something obvious, any suggestions?
Thanks,
Jon