Ansible Playbook: Retrieves a list of installed packages along with their versions before & After upgrading

Posted by


Below is an Ansible playbook script that performs the following actions sequentially:

  1. Retrieves a list of installed packages along with their versions before upgrading.
  2. Upgrades the operating system packages.
  3. Retrieves a list of installed packages along with their versions after the upgrade to compare which packages were upgraded.

This playbook assumes the target systems are using a Debian-based distribution like Ubuntu, as it utilizes the apt module for package management. Adjustments might be needed for other distributions.

Leave a Reply

Your email address will not be published. Required fields are marked *