ansible rpm compare
April 25, 2013
A while back I wrote this for func – and I found I needed it ported to ansible.
I enhanced it to make it take more than just 2 systems. It can now compare any number of systems to the base system
Takes a first argument of your ‘baseline’ host that’s the host all the other hosts package sets will be compared to.
It grabs the list of rpms installed on each system (just using rpm -qa, I’m lazy, or I could have used the yum list=installed option)
It transforms that output into a set – then does a difference on them each way.
Output looks like this
$ ans_rpm_compare.py app01.phx2.fedoraproject.org app02.phx2.fedoraproject.org
Packages on app01.phx2.fedoraproject.org not on app02.phx2.fedoraproject.org
Packages on app02.phx2.fedoraproject.org not on app01.phx2.fedoraproject.org
Trivial but should be straightforward to follow how it works in the code.
No idea where else to put it so it goes into my scripts git repo.