Skip to content

Instantly share code, notes, and snippets.

@martineg
Last active December 26, 2015 13:09
Show Gist options
  • Save martineg/7156398 to your computer and use it in GitHub Desktop.
Save martineg/7156398 to your computer and use it in GitHub Desktop.
minimal ansible report
# 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