Hello, im new to ansible.
I’m trying to update a test environment with the following playbook:
- name: Update VMs
hosts: VMs
tasks:
- name: Install Windows Updates
ansible.windows.win_updates:
server_selection: windows_update
reboot: yes
reboot_timeout: 600
state: installed
reject_list:
- KB5034439
category_names: '*'
become: true
become_method: runas
become_user: SYSTEM
On the first run it installed some updates.
On the second run it is not detecting any updates to install.
This is the result “-vvv” after the second run:
ok: [10.68.236.10] => {
4:22:04 PM
"changed": false,
4:22:04 PM
"failed_update_count": 0,
4:22:04 PM
"filtered_updates": {
4:22:04 PM
"a8a2d6e3-c6dc-4eb8-bcfb-8c8c7d947899": {
4:22:04 PM
"categories": [
4:22:04 PM
"Microsoft Server operating system-21H2",
4:22:04 PM
"Security Updates"
4:22:04 PM
],
4:22:04 PM
"downloaded": false,
4:22:04 PM
"filtered_reason": "blacklist",
4:22:04 PM
"filtered_reasons": [
4:22:04 PM
"reject_list"
4:22:04 PM
],
4:22:04 PM
"id": "a8a2d6e3-c6dc-4eb8-bcfb-8c8c7d947899",
4:22:04 PM
"installed": false,
4:22:04 PM
"kb": [
4:22:04 PM
"5034439"
4:22:04 PM
],
4:22:04 PM
"title": "2024-01 Security Update for Microsoft server operating system version 21H2 for x64-based Systems (KB5034439)"
4:22:04 PM
}
4:22:04 PM
},
4:22:04 PM
"found_update_count": 0,
4:22:04 PM
"installed_update_count": 0,
4:22:04 PM
"invocation": {
4:22:04 PM
"module_args": {
4:22:04 PM
"accept_list": null,
4:22:04 PM
"category_names": [
4:22:04 PM
"*"
4:22:04 PM
],
4:22:04 PM
"log_path": null,
4:22:04 PM
"reboot": true,
4:22:04 PM
"reboot_timeout": 600,
4:22:04 PM
"reject_list": [
4:22:04 PM
"KB5034439"
4:22:04 PM
],
4:22:04 PM
"server_selection": "windows_update",
4:22:04 PM
"skip_optional": false,
4:22:04 PM
"state": "installed"
4:22:04 PM
}
4:22:04 PM
},
4:22:04 PM
"reboot_required": false,
4:22:04 PM
"rebooted": false,
4:22:04 PM
"updates": {}
4:22:04 PM
}
But when i look at the GUI in windows, it still shows updates to be installed:
I use winrm to connect to the machine.
Am I missing something in my playbook? I have this issue on different VMs.