ansible rpm compare
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
http://fedorapeople.org/cgit/skvidal/public_git/scripts.git/tree/ansible/ans_rpm_compare.py
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
words-3.0-17.el6.noarch
fedmsg-relay-0.6.8-1.el6.noarch
gdb-7.2-60.el6.i686Packages 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.