|
1 | 1 | # Copyright 2021-2022 VMware, Inc. |
2 | 2 | # SPDX-License-Identifier: BSD-2-Clause |
3 | 3 | --- |
4 | | -- name: Set fact of VMware tools silent install command for 64bit GOS |
| 4 | +- name: "Set fact of VMware tools silent install command for 64bit GOS" |
5 | 5 | ansible.builtin.set_fact: |
6 | 6 | vmtools_install_cmd: "D:\\setup64.exe /s /v ADDLOCAL=ALL /qn REBOOT=R" |
7 | 7 | when: |
8 | 8 | - guest_os_ansible_architecture is defined |
9 | 9 | - guest_os_ansible_architecture == "64-bit" |
10 | | -- name: Set fact of VMware tools silent install command for 32bit GOS |
| 10 | +- name: "Set fact of VMware tools silent install command for 32bit GOS" |
11 | 11 | ansible.builtin.set_fact: |
12 | 12 | vmtools_install_cmd: "D:\\setup.exe /s /v ADDLOCAL=ALL /qn REBOOT=R" |
13 | 13 | when: |
14 | 14 | - guest_os_ansible_architecture is defined |
15 | 15 | - guest_os_ansible_architecture == "32-bit" |
16 | 16 |
|
17 | | -- name: Check the CDROM mounted path folder info |
| 17 | +- name: "Check the CDROM mounted path folder info" |
18 | 18 | include_tasks: ../utils/win_execute_cmd.yml |
19 | 19 | vars: |
20 | 20 | win_powershell_cmd: "Get-childitem -path D:\\ -name" |
21 | | -- name: Check VMware tools install files |
| 21 | +- name: "Check VMware tools install files" |
22 | 22 | ansible.builtin.assert: |
23 | 23 | that: |
24 | 24 | - "'setup.exe' in win_powershell_cmd_output['stdout_lines']" |
|
27 | 27 | fail_msg: "VMware tools installation setup files are not in D:\\" |
28 | 28 | success_msg: "VMware tools installation setup files are in D:\\" |
29 | 29 |
|
30 | | -- name: Execute VMware tools silent install command in guest |
31 | | - win_shell: "{{ vmtools_install_cmd }}" |
| 30 | +- name: "Execute VMware tools silent install command in guest" |
| 31 | + ansible.windows.win_shell: "{{ vmtools_install_cmd }}" |
32 | 32 | delegate_to: "{{ vm_guest_ip }}" |
33 | 33 | ignore_errors: true |
34 | 34 | register: wintools_install_result |
|
38 | 38 | ansible.builtin.pause: |
39 | 39 | minutes: 2 |
40 | 40 | - name: "Check VMware tools install task status every 3 seconds" |
41 | | - async_status: |
| 41 | + ansible.builtin.async_status: |
42 | 42 | jid: "{{ wintools_install_result.ansible_job_id }}" |
43 | 43 | register: job_result |
44 | 44 | delegate_to: "{{ vm_guest_ip }}" |
45 | | - until: job_result.finished |
| 45 | + until: job_result.finished is defined and job_result.finished |
46 | 46 | retries: 80 |
47 | 47 | delay: 3 |
| 48 | + when: |
| 49 | + - wintools_install_result is defined |
| 50 | + - wintools_install_result.ansible_job_id is defined |
48 | 51 |
|
49 | 52 | - include_tasks: ../utils/win_shutdown_restart.yml |
50 | 53 | vars: |
|
0 commit comments