I'm trying to populate the in-memory inventory, for multiple VMs, using the 
output from vmware_guest_facts. So I have run vmware_guest_facts and 
registered the output into a var called vm_facts. I can see that the output 
contains facts for every VM, including the IP address, as expected.

I then try to add the ip address for each VM into the inventory, as follows:

- name: add the dhcp addresses to the inventory
  add_host: name="{{ hw_eth0.ipaddresses[0] }}" groups=dhcp_ips
  with_items:
    - "{{ vm_facts }}"

But I only seem to be getting the IP address of the final VM in the 
inventory.

Any help on how I should be doing this would be greatly appreciated.

Jeff 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8e7b6888-6f70-4750-8fa9-6a11c971e207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to