Skip to content

Commit

Permalink
vmware_guest_info: Handle list in guest facts
Browse files Browse the repository at this point in the history
Handle list items in vSphere schema while handling facts in vmware_guest_info

Fixes: ansible-collections/community.vmware#33

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

This commit was initially merged in https://github.com/ansible-collections/community.vmware
See: ansible-collections/community.vmware@6a4fe4f
  • Loading branch information
Akasurde authored and machacekondra committed Mar 8, 2024
1 parent ae8ce15 commit edb775a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/integration/targets/vmware_guest_info/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,27 @@
- "guest_info_0001['instance']['vimref'] is defined"
- "guest_info_0002b['instance']['overallStatus'] is not defined"

# https://github.com/ansible-collections/vmware/issues/33
- name: Get specific details about VM using the vsphere output schema
vmware_guest_info:
validate_certs: False
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ dc1 }}"
uuid: "{{ vm1_uuid }}"
schema: vsphere
properties:
- config.hardware.device.deviceInfo.summary
register: guest_info_with_list

- debug:
var: guest_info_with_list

- assert:
that:
- "guest_info_with_list['instance']['config']['hardware']['device'] is defined"

# Testcase 0003: Get details about virtual machines without snapshots using UUID
- name: get empty list of snapshots from virtual machine using UUID
vmware_guest_info:
Expand Down

0 comments on commit edb775a

Please sign in to comment.