I have ran this playbook again with the -vvv this was the out put:
`
[vagrant@controller win_10_Updates]$ ansible-playbook testFeatureUPdate.yml -vvv
ansible-playbook 2.9.10
config file = /etc/ansible/ansible.cfg
configured module search path = [‘/home/vagrant/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
PLAYBOOK: testFeatureUPdate.yml **********************************************************************************************
1 plays in testFeatureUPdate.yml
PLAY [win10-pro-1] ***********************************************************************************************************
TASK [Gathering Facts] *******************************************************************************************************
task path: /home/vagrant/ansible/win_10_Updates/testFeatureUPdate.yml:2
Using module file /usr/lib/python3.6/site-packages/ansible/modules/windows/setup.ps1
Pipelining is enabled.
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
ok: [win10-pro-1]
META: ran handlers
TASK [Re-Boot PC before upgrade] *********************************************************************************************
task path: /home/vagrant/ansible/win_10_Updates/testFeatureUPdate.yml:5
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
win_reboot: rebooting server…
EXEC (via pipeline wrapper)
win_reboot: validating reboot
win_reboot: attempting to get system boot time
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
win_reboot: attempting to get system boot time
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
win_reboot: attempting to get system boot time
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
win_reboot: attempting to get system boot time
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
win_reboot: attempting post-reboot test command
EXEC (via pipeline wrapper)
win_reboot: system successfully rebooted
changed: [win10-pro-1] => {
“changed”: true,
“elapsed”: 23,
“rebooted”: true
}
TASK [Upgrade Windows 10] ****************************************************************************************************
task path: /home/vagrant/ansible/win_10_Updates/testFeatureUPdate.yml:8
win_updates: running win_updates module
Using module file /usr/lib/python3.6/site-packages/ansible/modules/windows/win_updates.ps1
Pipelining is enabled.
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
ok: [win10-pro-1] => {
“changed”: false,
“failed_update_count”: 0,
“filtered_updates”: {},
“found_update_count”: 1,
“installed_update_count”: 1,
“reboot_required”: true,
“updates”: {
“ac2b20ab-6186-4267-8d55-4b3ca35197d1”: {
“categories”: [
“Upgrades”
],
“id”: “ac2b20ab-6186-4267-8d55-4b3ca35197d1”,
“installed”: true,
“kb”: [
“4560960”
],
“title”: “Feature update to Windows 10, version 1909”
}
}
}
TASK [reboot host if required] ***********************************************************************************************
task path: /home/vagrant/ansible/win_10_Updates/testFeatureUPdate.yml:15
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
win_reboot: rebooting server…
EXEC (via pipeline wrapper)
win_reboot: validating reboot
win_reboot: attempting to get system boot time
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
win_reboot: attempting to get system boot time
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
win_reboot: attempting to get system boot time
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
win_reboot: attempting to get system boot time
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
EXEC (via pipeline wrapper)
ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO win10-pro-1
win_reboot: attempting post-reboot test command
EXEC (via pipeline wrapper)
win_reboot: system successfully rebooted
changed: [win10-pro-1] => {
“changed”: true,
“elapsed”: 25,
“rebooted”: true
}
META: ran handlers
META: ran handlers
PLAY RECAP *******************************************************************************************************************
win10-pro-1 : ok=4 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
`
But when I go into the windows box and look at updates this is what I get:
I used Ansible to restart the PC but is does not install it. This is what I used to restart it. If I actually press the restart now button or go into the start menu and choose update and restart it installs.
`