Reporting on dry run package updates

Hi,

On a weekly basis I upgrade any packages for which there are available updates on our servers. I first perform this in our test environment, and then once happy with those changes, in our production environment. Though it’s not a massive task, I have started to look at how I could do this with ansible in order to automate the task.

I found check mode in the documentation, and was interested to see the --diff option too. I hoped that by using --check and -diff when running a simple playbook which updated the package sources and then did an apt-get upgrade, the output would essentially be a report informing me of which updates were available for each of the machines I manage. This wasn’t the case though.

The apt module is in core, and the documentation suggests that “any module instrumented to support ‘check mode’ (which contains most of the primary core modules, but it is not required that all modules do this)”. Does the apt module support check? If it doesn’t, can anyone recommend an alternative?

I have also browsed the projects available on ansible Galaxy, the closest I could find to what I wanted to achieve was built to do unattended upgrade. My requirement though is to report on the changes available before committing to making those changes.

Any help or pointers to projects that achieve similar would be appreciated.

Thanks!

Dan.