|
|
@ -80,3 +80,26 @@
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- "guest_facts_0001['instance']['hw_name'] == vm1 | basename"
|
|
|
|
- "guest_facts_0001['instance']['hw_name'] == vm1 | basename"
|
|
|
|
- "guest_facts_0001['instance']['hw_product_uuid'] is defined"
|
|
|
|
- "guest_facts_0001['instance']['hw_product_uuid'] is defined"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- set_fact: vm1_uuid="{{ guest_facts_0001['instance']['hw_product_uuid'] }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- debug: var=vm1_uuid
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Testcase 0002: Get details about virtual machines using UUID
|
|
|
|
|
|
|
|
- name: get list of facts about virtual machines using UUID
|
|
|
|
|
|
|
|
vmware_guest_facts:
|
|
|
|
|
|
|
|
validate_certs: False
|
|
|
|
|
|
|
|
hostname: "{{ vcsim }}"
|
|
|
|
|
|
|
|
username: "{{ vcsim_instance['json']['username'] }}"
|
|
|
|
|
|
|
|
password: "{{ vcsim_instance['json']['password'] }}"
|
|
|
|
|
|
|
|
datacenter: "{{ dc1 | basename }}"
|
|
|
|
|
|
|
|
uuid: "{{ vm1_uuid }}"
|
|
|
|
|
|
|
|
register: guest_facts_0002
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- debug: msg="{{ guest_facts_0002 }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- "guest_facts_0002['instance']['hw_name'] == vm1 | basename"
|
|
|
|
|
|
|
|
- "guest_facts_0002['instance']['hw_product_uuid'] is defined"
|
|
|
|
|
|
|
|
- "guest_facts_0002['instance']['hw_product_uuid'] == vm1_uuid"
|
|
|
|