Closed
Description
SUMMARY
When using ansible.windows.win_updates
, we need to verify the updates are installed or not. When we register the output of ansible.windows.win_updates
task, we are getting the output as "installed": false,
which i
7826
s wrong (!)
ISSUE TYPE
- Bug Report
COMPONENT NAME
ansible.windows.win_updates
ANSIBLE VERSION
ansible [core 2.11.4]
config file = /Users/gini/bau/ansible-bau-windows-patching/ansible.cfg
configured module search path = ['/Users/gini/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /Users/gini/python-venv/ansible210/lib/python3.9/site-packages/ansible
ansible collection location = /Users/gini/bau/ansible-bau-windows-patching/collections
executable location = /Users/gini/python-venv/ansible210/bin/ansible
python version = 3.9.9 (main, Nov 21 2021, 03:23:44) [Clang 13.0.0 (clang-1300.0.29.3)]
jinja version = 3.0.3
libyaml = True
COLLECTION VERSION
Collection Version
--------------- -------
ansible.windows 1.9.0
CONFIGURATION
$ ansible-config dump --only-changed
COLLECTIONS_PATHS(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = ['/Users/gini/bau/ansible-bau-win
DEFAULT_BECOME_ASK_PASS(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = False
DEFAULT_BECOME_METHOD(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = sudo
DEFAULT_BECOME_USER(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = root
DEFAULT_FORKS(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = 25
DEFAULT_HOST_LIST(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = ['/Users/gini/bau/ansible-bau-win
DEFAULT_REMOTE_USER(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = ansible
DEFAULT_ROLES_PATH(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = ['/Users/gini/bau/ansible-bau-wi
DEFAULT_TIMEOUT(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = 5
HOST_KEY_CHECKING(/Users/gini/bau/ansible-bau-windows-patching/ansible.cfg) = False
OS / ENVIRONMENT
MacOS
$ sw_vers
ProductName: macOS
ProductVersion: 12.1
BuildVersion: 21C52
STEPS TO REPRODUCE
- Create a simple task to update windows and register the output
- print the registered variable to see the update status.
- name: Updating packages on Windows
ansible.windows.win_updates:
category_names:
- "*"
reboot: no
skip_optional: "{{ winupdate_skip_optional }}"
state: installed
#log_path:
register: package_update_status
ignore_errors: yes
- debug:
msg: "{{ package_update_status }}"
EXPECTED RESULTS
The registered output should contain installed: true
if the update is installed successfully.
ACTUAL RESULTS
Check below.
TASK [os-patching-windows : debug] ****************************************************************************
ok: [win2019] => {
"msg": {
"changed": false,
"failed": false,
"failed_update_count": 0,
"filtered_updates": {},
"found_update_count": 4,
"installed_update_count": 0,
"reboot_required": false,
"updates": {
"148819ed-5f74-4426-a455-38ac288a5e67": {
"categories": [
"Security Updates",
"Windows Server 2019"
],
"downloaded": false,
"id": "148819ed-5f74-4426-a455-38ac288a5e67",
"installed": false,
"kb": [
"5009718"
],
"title": "2022-01 Cumulative Update for .NET Framework 3.5, 4.7.2 and 4.8 for Windows Server 2019 for x64 (KB5009718)"
},
"a3b20bee-07e8-4eb6-95ba-1008677c9a7c": {
"categories": [
"Security Updates"
],
"downloaded": false,
"id": "a3b20bee-07e8-4eb6-95ba-1008677c9a7c",
"installed": false,
"kb": [
"5009557"
],
"title": "2022-01 Cumulative Update for Windows Server 2019 (1809) for x64-based Systems (KB5009557)"
},
Metadata
Metadata
Assignees
Labels
No labels