I am trying to collect all vms in four different vcenters to create inventory and further act on the that inventory. Using vmware_vm_inventory, I can target one vcenter and hostname does not support a list:
Not sure exactly what details you need from VMs, but defining vcenters as vars or part of your inventory will get you a list of vms using vmware_vm_info. Just update the vars section and add as many VCs as you’d like. You will end up with a list of vcenters and whitin the VM details.
Thanks Rodrigues. The ended up using separate inventory file for each vcenter and than specifying them with multiple -i flags like so:
ansible-inventory -i inventory_file1.yml -i inventory_file2.yml -i inventory_file3.yml
to get all the vms in all the vcenters.