# Playbook is unable to install specified KB number updates but shows OK  in playbook recap

**URL:** <https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [January 23, 2020, 5:46pm UTC](https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041 "2020-01-23T17:46:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Work\_Email](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@Work\_Email](https://forum.ansible.com/u/Work_Email)\
**Post date:** [January 23, 2020, 5:46pm UTC](https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041/1 "2020-01-23T17:46:15Z")

</div>

**KB number upgrades/ security patches are not installing?**  
**Playbook**  
tasks:

- name: Install all security, critical, and rollup updates without a scheduled task  
win\_updates:  
category\_names:
- Upgrades
- SecurityUpdates  
whitelist:
- KB4494452
- **KB2267602**
- KB4494452  
state: installed  
register: update\_result  
win\_reboot: yes

**For one of my server, it’s still filtering out. I have provided KB2267602. it’s not installing why ?**  
ok: [[EC2AMAZ-3FFNIJH.CORP.MEDQIA.COM](http://EC2AMAZ-3FFNIJH.CORP.MEDQIA.COM)] =\> {  
“changed”: false,  
“filtered\_updates”: {  
“1b20f24b-2b80-43cb-8511-4677f3915843”: {  
“categories”: [  
“Definition Updates”,  
“Windows Defender”  
],  
“filtered\_reason”: “category\_names”,  
“id”: “1b20f24b-2b80-43cb-8511-4677f3915843”,  
“installed”: false,  
“kb”: [  
“2267602”  
],  
“title”: “Security Intelligence Update for Windows Defender Antivirus - **KB2267602** (Version 1.307.2889.0)”  
}  
},

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[EC2AMAZ-3FFNIJH.CORP.MEDQIA.COM](http://EC2AMAZ-3FFNIJH.CORP.MEDQIA.COM) : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0  
[MQN-CKMH5E31UM7.corp.medqia.com](http://MQN-CKMH5E31UM7.corp.medqia.com) : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0  
[jimmy.corp.medqia.com](http://jimmy.corp.medqia.com) : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0  
[mqn-huddlermpc.corp.medqia.com](http://mqn-huddlermpc.corp.medqia.com) : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 23, 2020, 7:52pm UTC](https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041/2 "2020-01-23T19:52:21Z")

</div>

since it works for other hosts, the problem is related to that specific host, not ansible.

There may be many reasons why it doesn’t work.  
Since ansible is just an automation tool, best to try an troubleshoot things manually on that host.

---

<div class="post-metadata">

**Author:** ![Work\_Email](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@Work\_Email](https://forum.ansible.com/u/Work_Email)\
**Post date:** [January 23, 2020, 8:00pm UTC](https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041/3 "2020-01-23T20:00:00Z")

</div>

I have tried multiple machines to download the updates but it’s not working.  
**Playbook**

**tasks:**  
**- name: Search and download Windows updates without installing them**  
**win\_updates:**  
**state: downloaded**  
**win\_reboot: true**

**Throwing error -**

fatal: [[EC2AMAZ-5TQR7L8.corp.medqia.com](http://EC2AMAZ-5TQR7L8.corp.medqia.com)]: FAILED! =\> {“changed”: false, “filtered\_updates”: {“ca3bb521-a8ea-4e26-a563-2ad6e3108b9a”: {“categories”: [“Feature Packs”, “Silverlight”], “filtered\_reason”: “category\_names”, “id”: “ca3bb521-a8ea-4e26-a563-2ad6e3108b9a”, “installed”: false, “kb”: [“4481252”], “title”: “Microsoft Silverlight (KB4481252)”}}, “found\_update\_count”: 2, “installed\_update\_count”: 0, “msg”: “A reboot is required before more updates can be installed”, “reboot\_required”: true, “updates”: {“46de78a6-89c2-4adc-a827-d55e913ca853”: {“categories”: [“Security Updates”, “Windows Server 2016”], “id”: “46de78a6-89c2-4adc-a827-d55e913ca853”, “installed”: false, “kb”: [“4534271”], “title”: “2020-01 Cumulative Update for Windows Server 2016 for x64-based Systems (KB4534271)”}, “a4816cdf-d87e-4555-afa3-b839655fc564”: {“categories”: [“Update Rollups”, “Windows Server 2016”], “id”: “a4816cdf-d87e-4555-afa3-b839655fc564”, “installed”: false, “kb”: [“890830”], “title”: “Windows Malicious Software Removal Tool x64 - January 2020 (KB890830)”}}}

**I have already enabled the command to reboot. why it’s not rebooting ? I can’t download or install anything through ansible… kinda sucks**

---

<div class="post-metadata">

**Author:** ![nschende](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nschende/32/1681_2.png) [@nschende](https://forum.ansible.com/u/nschende)\
**Post date:** [January 23, 2020, 8:09pm UTC](https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041/4 "2020-01-23T20:09:05Z")

</div>

Based on that message it appears that a reboot is requried before you can install the patches. The win\_updates module is not going to reboot the host after changes if it doesnt make any changes. Reboot the host manually, then try running again and I bet it goes. Otherwise you could probably put in a separate task to reboot the host first, then patch and reboot after if needed.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [January 23, 2020, 8:20pm UTC](https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041/5 "2020-01-23T20:20:44Z")

</div>

The filtered message says it’s filtered due to category\_names, here are the categories you’ve applied in one of your tasks

- Upgrades
- Security Updates

When you omit the category\_names here are the categories it uses by default (as per the docs)

- CriticalUpdates (same as “Critical Updates”)
- SecurityUpdates (same as “Security Updates”)
- UpdateRollups (same as “Update Rollups”)

Here are the categories for KB2267602

- Definition Updates
- Windows Defender

You can see that none of the categories for KB2267602 are matching up in either of your tasks so they are being filtered out, hence the “filtered\_reason”: “category\_names” entry in the filtered list.

For an update to not be filtered you MUST specify at least one of the categories it belongs to, you have not done this. The whitelist/blacklist is only applied to updates that have already matched the categories as per the documentation

> The whitelist is only validated on updates that were found based on _category\_names_. It will not force the module to install an update if it was not in the category specified.

You cannot just specify a whitelist of categories and expect them to be match, they MUST first be part of the categories you have specified.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [January 23, 2020, 8:24pm UTC](https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041/6 "2020-01-23T20:24:04Z")

</div>

Then finally for your last message, I’ve already told you in [https://groups.google.com/forum/#!topic/ansible-project/ME6fY1n7SCA](https://groups.google.com/forum/#!topic/ansible-project/ME6fY1n7SCA) why it’s failing the reboot check.

Firstly

1. The reboot option in win\_updates is ‘reboot: yes’, not ‘win\_reboot: yes’, you would know that if you had read the docs and understand how the options work. The win\_reboot module is a completely separate module

2. I’ve said in your original post that the win\_updates module only handles reboots post installation, if a reboot is required before the install it won’t do that  
Arguably 2 is something that we can do but it’s just not something that is available right now. Feel free to submit a PR to add that functionality if you desire it.

---

<div class="post-metadata">

**Author:** ![Work\_Email](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@Work\_Email](https://forum.ansible.com/u/Work_Email)\
**Post date:** [January 24, 2020, 1:45am UTC](https://forum.ansible.com/t/playbook-is-unable-to-install-specified-kb-number-updates-but-shows-ok-in-playbook-recap/32041/7 "2020-01-24T01:45:51Z")

</div>

**Thank you, it worked**
