Ansible Playbook for Windows Patching

Folks,

I am using below pasted playbook for windows server patching which has variable file defined along with.
It is supposed to take KB number mentioned in variable file and install it on server, followed by server reboot.

Problem is that, the said playbook is getting executed without any issue and also rebooting the server however its not installing mentioned KB patches on server as expected.

Please suggest.

Playbook

That kb_list var has unquoted items?

I just updated my kb_list var with using single and even double quotes but its simply ignoring variable file and just rebooting windows server.

kb_list: [‘KB5006065’, ‘KB890830’]

kb_list: [“KB5006065”, “KB890830”]

These are the changes you were suggesting or anything different?

This is what I meant yes.
I don’t have other clues, I’m not familiar with that os’ modules.

Have a look at the output of win_updates, it will tell you what updates were selected and the ones that were not. The ones that are “filtered” (not selected) will have a reason which states why they were filtered out. If the update doesn’t appear in the output at all then Windows couldn’t find it and thus cannot be installed.

V’s are your friends; use a couple at least. -vv
Also, run with state: searched to see what updates are actually available.

without much Ansible experience:

  1. the blank line (22) looks suspicious
  2. would you need to add spaces between " {{ }} " for calling the variable in line 23?