Unable to install Windows Updates using Ansible 'win_update' Module

Hello Team,

We’re using the ‘win_updates’ module for installing Windows updates on servers, following is the playbook section:

tasks:

  • name: Applying Security Windows Updates
    win_updates:
    category_name:
  • SecurityUpdates
  • UpdateRollups
    whitelist:
  • KB2992611
  • KB4103730
    log_path: C:\ansible_wu.txt
    register: wuout

Even after white listing these updates, they were not installed. Following are the logs:

2018-05-09 23:57:46Z Skipping update c5406426-d347-4a93-acbb-e595a00a4fb8 - Security Update for Windows Server 2012 (KB2992611) as it was not found in the whitelist

2018-05-09 23:57:46Z Skipping update bfdb9786-0c43-40be-ab19-654fc8d32dd8 - 2018-05 Security Monthly Quality Rollup for Windows Server 2012 for x64-based Systems (KB4103730) as it was not found in the whitelist

What could be the reason and how can we resolve this issue?

Thank you,
Dinesh

This sounds like it could be an issue with the whitelist functionality of win_updates. I know I had it working for single updates but can’t fully remember if I tested it with multiple updates but I thought I did. Can you raise an issue with these details at https://github.com/ansible/ansible/issues and I will get round to testing it sometime soon.

Thanks

Jordan

Found the issue and have raised a PR to fix it. If you can test it out that would be great https://github.com/ansible/ansible/pull/40283.

Thanks

Jordan

Jordan,

After replacing the win_updates.ps1 module with the one shared in the above link the problem is resolved.

Now we can install multiple updates by whitelisting them.

Thank you,
Dinesh