Last active
December 26, 2015 13:09
-
-
Save martineg/7156398 to your computer and use it in GitHub Desktop.
minimal ansible report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first: | |
# $ ansible --tree facts all -m setup | |
import glob | |
import json | |
from collections import Counter | |
reports = { node['ansible_fqdn'] : node for node in [ r['ansible_facts'] for r in [ json.load(open(f)) for f in glob.glob("reports/*") ] if r.has_key('ansible_facts') ]} | |
print "Most common memory sizes:" | |
print Counter([ m['ansible_memtotal_mb'] for m in reports.values() ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment