Trying to install Feature update to Windows 10, version 1909 with Ansible

Hello I am trying to install windows 10 feature updates or upgrades. The playbook I am using seems to download it but it will not install it. I still need to go into windows updates and hit retry then it installs. This is the playbook I am currently using:

`

Can anyone help with this?

I have also tired these:

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.

`

Sorry here is the rest of the output from the play with -vvv it got cut off for some reason:

`
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

`

Hi Alan,

Can you please check if the ansible account you are using for winrm has all root permissions i.e Administrator

This is weird. I have achieved the same result back 6 months and it went smooth for me.

Regards,
Manash

Hi Corleone, the account that I am using is in the Administrators group on the windows 10 boxes. Right now, I am using a Dev environment using Vagrant. I have 4 windows 10 boxes that are all from Vagrant Cloud and a centos box for the ansible controller that is also from Vagrant Cloud. So, by default the Vagrant user is always an admin on the boxes.

I did also try to install Google Chrome with Ansible on these boxes with this playbook and it does work just to test it. Google Chrome does get installed:

`

Would you mind sharing you playbook for the upgrade install?

Have you used the win feature module before?

Regards,
Manash

I have. I have used it for installing IIS and a few other features.