# Trying to upgrade Windows 10 and install updates with Ansible.

**URL:** <https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [July 24, 2020, 4:07pm UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487 "2020-07-24T16:07:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan\_Woods](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Alan\_Woods](https://forum.ansible.com/u/Alan_Woods)\
**Post date:** [July 24, 2020, 4:07pm UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487/1 "2020-07-24T16:07:19Z")

</div>

Hello, I am trying to install windows updates with Ansible and for some reason it is not working. This is what I have so far.

My PlayBook

 ![My playbook.png](https://us1.discourse-cdn.com/ansible/original/2X/e/e70e75f57e964f175d686782087a39c9c6df6ef4.png)

This is the results after the play runs:

 ![Results after it runs.png](https://us1.discourse-cdn.com/ansible/original/2X/0/081d568f05e43d3322dd480e6ba90bab771ddac2.png)

Then when I go to the windows 10 machine this is what I see when i look at the updates:

 ![windows 10 update.png](https://us1.discourse-cdn.com/ansible/original/2X/7/7f2db22394ec12a31ad872811891eb814e870754.png)

I am not sure if I maybe am not covering the correct category or what. I have also tried to upgrade a 1803 windows 10 to 1909 with no avail. Can anyone help me with getting ansible to be able to update windows.

The account I am using is a admin on the windows 10 machine. I also have another play book that uses the win\_chocolatey module to install Apps and it installs them fine. So, I don’t think this can be a permission issue.

---

<div class="post-metadata">

**Author:** ![Magnus\_Lubeck](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/magnus_lubeck/32/3905_2.png) [@Magnus\_Lubeck](https://forum.ansible.com/u/Magnus_Lubeck)\
**Post date:** [July 27, 2020, 9:34am UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487/2 "2020-07-27T09:34:36Z")

</div>

Hi Alan,

Extend the list of “category\_names” to include more or less all and any possible category.

What happens when you run the playbook, is that it only lists and installs the ones that you states in the “category\_names”, whereas the Windows Update in your clients will search for all and anything it can. Hence, you might not have installed all updates that are available.

For example, for our Windows 2016 servers, we use the list:

category\_names:

- Application

- Connectors

- CriticalUpdates

- DefinitionUpdates

- DeveloperKits

- FeaturePacks

- Guidance

- SecurityUpdates

- ServicePacks

- Tools

- UpdateRollups

- Updates

I wish you a nice day!  
//magnus

> **(attachments)**
>
> ![My playbook.png](https://us1.discourse-cdn.com/ansible/original/2X/e/e70e75f57e964f175d686782087a39c9c6df6ef4.png)  
> ![Results after it runs.png](https://us1.discourse-cdn.com/ansible/original/2X/0/081d568f05e43d3322dd480e6ba90bab771ddac2.png)  
> ![windows 10 update.png](https://us1.discourse-cdn.com/ansible/original/2X/7/7f2db22394ec12a31ad872811891eb814e870754.png)

---

<div class="post-metadata">

**Author:** ![Alan\_Woods](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Alan\_Woods](https://forum.ansible.com/u/Alan_Woods)\
**Post date:** [July 29, 2020, 9:48pm UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487/3 "2020-07-29T21:48:57Z")

</div>

Hello Magnus,

I added all the categories you have that I did not have. This is now my playbook:

`

---

<div class="post-metadata">

**Author:** ![Alan\_Woods](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Alan\_Woods](https://forum.ansible.com/u/Alan_Woods)\
**Post date:** [July 29, 2020, 10:14pm UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487/4 "2020-07-29T22:14:34Z")

</div>

Sorry here is the image.

 ![updates.png](https://us1.discourse-cdn.com/ansible/original/2X/e/ee6afcff03733257df519cc9aaaa52f517c22807.png)

---

<div class="post-metadata">

**Author:** ![Alan\_Woods](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Alan\_Woods](https://forum.ansible.com/u/Alan_Woods)\
**Post date:** [July 29, 2020, 10:25pm UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487/5 "2020-07-29T22:25:38Z")

</div>

My end goal it actually not to install all teh windows updates. I am just wanting to upgrade windows 10 boxes to 1909 and the 2004 updates. I am trying to get a group of Windows 10 PC of 5-10 and run a upgrade playbook and install the 1909 and the 2004 update after hours when the users are not at there PCs.

---

<div class="post-metadata">

**Author:** ![Alan\_Woods](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Alan\_Woods](https://forum.ansible.com/u/Alan_Woods)\
**Post date:** [July 31, 2020, 4:39pm UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487/6 "2020-07-31T16:39:33Z")

</div>

So here is an issue I am having I am trying to get the Feature update to windows 10 version 1909 installed using Ansible. When I go to Update & Security this is what I see:

 ![1.png](https://us1.discourse-cdn.com/ansible/original/2X/5/51e86dae0ee11e7255f52eadb5d3269a8012113f.png)

Then I run this playbook to install that update, and this is the outcome.

Playbook:

`

---

<div class="post-metadata">

**Author:** ![Alan\_Woods](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Alan\_Woods](https://forum.ansible.com/u/Alan_Woods)\
**Post date:** [July 31, 2020, 4:46pm UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487/7 "2020-07-31T16:46:04Z")

</div>

![](https://us1.discourse-cdn.com/ansible/original/2X/5/51e86dae0ee11e7255f52eadb5d3269a8012113f.png)

---

<div class="post-metadata">

**Author:** ![Magnus\_Lubeck](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/magnus_lubeck/32/3905_2.png) [@Magnus\_Lubeck](https://forum.ansible.com/u/Magnus_Lubeck)\
**Post date:** [August 1, 2020, 8:15am UTC](https://forum.ansible.com/t/trying-to-upgrade-windows-10-and-install-updates-with-ansible/33487/8 "2020-08-01T08:15:12Z")

</div>

Oh, that is a whole different thing. I have never tried that.

I assume you might have to find a clever powershell one-liner to detect it, and another one to trigger the installation.

//magnus

> **(attachments)**
>
> ![1.png](https://us1.discourse-cdn.com/ansible/original/2X/5/51e86dae0ee11e7255f52eadb5d3269a8012113f.png)
