- name: Get list of available updates
ansible.builtin.dnf:
list: updates
register: dnf_available_patches
- name: Display available updates
ansible.builtin.debug:
var: dnf_available_patches
The output shows more updates than what the normal dnf list updates command shows.
Example: Actual updates = 14, but Ansible shows 56.
It looks like the module lists packages from all architectures and repos, not just the unique ones like the normal dnf command does.
This is causing confusion in our post-patching reports (available vs installed counts don’t match).
Questions:
Is this normal behavior of the ansible.builtin.dnf module, or a known bug?
Is there a way to list only security or bugfix updates using this module (without using shell commands)?
This is part of our end-to-end automated patching setup triggered by ITSM, so reporting accuracy is important.
using ansible.builtin.dnf (or .dnf5) with list: updates gives me a different number than using the shell command, and ansible.builtin.package_facts does indeed show all installed packages, and I can’t find anything in the output indicating which of them are updateable.
I will also note that on my test system, the difference was one package, and it was one NOT in the updates repo.