Last active
December 29, 2015 00:29
-
-
Save binford2k/7586795 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#! /opt/puppet/bin/ruby | |
require 'json' | |
raise "Run this script with a node name that has had a catalog compiled on this master" unless ARGV.size == 1 | |
catalog = JSON.parse(File.read("/var/opt/lib/pe-puppet/client_data/catalog/#{ARGV[0]}.json")) | |
puts " Class count: #{catalog['data']['resources'].select { |r| r['type'] == 'Class' }.size}" | |
puts "Resource count: #{catalog['data']['resources'].reject { |r| r['type'] == 'Class' }.size}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment