I'm trying to pull out the "uuid" from facts returned by ansible's vmware_vm_facts module. There is a solution to a similar question posted on Reddit, but when I try that, it fails with 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'ip_address'
Here is my code:
- name: Test vmware_vm_facts
vmware_vm_facts:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
delegate_to: localhost
register: rc
- name: Debug...
debug:
msg: "IP of {{ item.key }} is {{ item.value.ip_address }}and power is {{ item.value.power_state }}"
with_dict: "{{ rc.virtual_machines }}"
Anyone have any ideas? Thanks!
item
?