With 470-CVE months becoming normal, I want one command that tells me which servers are behind. Here’s the shape of my Ansible check, with no inventory details.
- Group by family: put Debian/Ubuntu and RHEL-family hosts in separate inventory groups.
- Debian/Ubuntu: run
apt list --upgradablewith the command module (changed_when: false) and register the output. - RHEL family: run
dnf -q updateinfo list --securitythe same way. - Reboot check: look for
/var/run/reboot-requiredwith the stat module, orneeds-restarting -ron dnf systems. - Report: use debug or a template to print host, pending count and reboot status in one table.
- Then patch: a separate playbook with
serial: 1applies updates and reboots one host at a time.
Keep the check read-only so it’s safe to run any time. Patch on purpose, not by accident.
God Bless, and May the Source Be with You!