From d2a1b75913f894fdf668d89f9a5f0f32b1292426 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Fri, 8 Jun 2018 00:32:17 +0530 Subject: [PATCH] VMware: update vmware_guest_tools_wait examples (#41246) Signed-off-by: Abhijeet Kasurde --- .../cloud/vmware/vmware_guest_tools_wait.py | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest_tools_wait.py b/lib/ansible/modules/cloud/vmware/vmware_guest_tools_wait.py index 7035c8c4d72..d9abaace30d 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest_tools_wait.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest_tools_wait.py @@ -61,23 +61,35 @@ extends_documentation_fragment: vmware.documentation EXAMPLES = ''' - name: Wait for VMware tools to become available by UUID - vmware_guest_tools_wait: - hostname: 192.168.1.209 - username: administrator@vsphere.local - password: vmware + vmware_guest_facts: + hostname: "{{ vcenter_server }}" + username: "{{ vcenter_user }}" + password: "{{ vcenter_pass }}" validate_certs: no - uuid: 421e4592-c069-924d-ce20-7e7533fab926 + datacenter: "{{ datacenter }}" + folder: "/{{datacenter}}/vm" + name: "{{ vm_name }}" + register: vm_facts + +- name: Get UUID from previous task and pass it to this task + vmware_guest_tools_wait: + hostname: "{{ vcenter_server }}" + username: "{{ vcenter_user }}" + password: "{{ vcenter_pass }}" + validate_certs: no + uuid: "{{ vm_facts.instance.hw_product_uuid }}" delegate_to: localhost register: facts + - name: Wait for VMware tools to become available by name vmware_guest_tools_wait: - hostname: 192.168.1.209 - username: administrator@vsphere.local - password: vmware + hostname: "{{ vcenter_server }}" + username: "{{ vcenter_user }}" + password: "{{ vcenter_pass }}" validate_certs: no name: test-vm - folder: /datacenter1/vm + folder: "/{{datacenter}}/vm" delegate_to: localhost register: facts '''