In Packer template as shown below...I use generate inventoryfile powershell script which creates IP address and store it in packer-guest.yml, If you look at the 2nd powershell provsioner entry. in the attached image.. if I split the command then it thows the following error.
> vsphere-iso: Downloading packer-guest.yml => /tmp/packer/vm_templates/templates/../../playbook/packer-guest.yml
==> vsphere-iso: Running local shell script: /tmp/packer-shell185851134
==> vsphere-iso: [WARNING]: provided hosts list is empty, only localhost is available. Note
==> vsphere-iso: that the implicit localhost does not match 'all'
vsphere-iso:
==> vsphere-iso: [WARNING]: Could not match supplied host pattern, ignoring: windows
I don't understand why in the above code
But if I use in the single like then above errors are disappear, Not sure Why. Appreciate anyone can shed some light on this.
{
"type": "powershell",
"inline": ["a:\\scripts\\generate-inventory-file.ps1 -hosts_group 'windows'"]