53 lines
No EOL
1.7 KiB
YAML
53 lines
No EOL
1.7 KiB
YAML
# Test code for the vmware_guest_tools_info module
|
|
# Copyright: (c) 2019, Diane Wang (Tomorrow9) <dianew@vmware.com>
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
- when: vcsim is not defined
|
|
block:
|
|
- import_role:
|
|
name: prepare_vmware_tests
|
|
vars:
|
|
setup_attach_host: true
|
|
setup_datastore: true
|
|
setup_virtualmachines: true
|
|
|
|
- name: get instance uuid of virtual machine
|
|
vmware_guest_info:
|
|
validate_certs: False
|
|
hostname: "{{ vcenter_hostname }}"
|
|
username: "{{ vcenter_username }}"
|
|
password: "{{ vcenter_password }}"
|
|
name: "{{ virtual_machines[0].name }}"
|
|
datacenter: "{{ dc1 }}"
|
|
register: guest_info
|
|
- debug: var=guest_info
|
|
|
|
- name: get VMware tools info of virtual machine by instance uuid
|
|
vmware_guest_tools_info:
|
|
validate_certs: False
|
|
hostname: "{{ vcenter_hostname }}"
|
|
username: "{{ vcenter_username }}"
|
|
password: "{{ vcenter_password }}"
|
|
uuid: "{{ guest_info['instance']['instance_uuid'] }}"
|
|
use_instance_uuid: True
|
|
register: vmtools_info
|
|
- debug: var=vmtools_info
|
|
- name: assert VMware tools info returned
|
|
assert:
|
|
that:
|
|
- "vmtools_info.vmtools_info.vm_tools_install_status != ''"
|
|
|
|
- name: get VMware tools info of virtual machine by name
|
|
vmware_guest_tools_info:
|
|
validate_certs: False
|
|
hostname: "{{ vcenter_hostname }}"
|
|
username: "{{ vcenter_username }}"
|
|
password: "{{ vcenter_password }}"
|
|
name: "{{ virtual_machines[0].name }}"
|
|
datacenter: "{{ dc1 }}"
|
|
register: vmtools_info
|
|
- debug: var=vmtools_info
|
|
- name: assert VMware tools info returned
|
|
assert:
|
|
that:
|
|
- "vmtools_info.vmtools_info.vm_tools_install_status != ''" |