When using the below task:
- 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.dnfmodule, 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.