Skip to content

Instantly share code, notes, and snippets.

@ohadlevy
Created November 19, 2009 15:44
Show Gist options
  • Save ohadlevy/238827 to your computer and use it in GitHub Desktop.
Save ohadlevy/238827 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
query = ARGV[0]
if query.nil?
warn "usage: #{$0} classname"
exit 1
end
require "puppet"
Dir.glob("/var/lib/puppet/yaml/node/*yaml").each do |node|
yaml = YAML.load_file node
puts yaml.name if yaml.classes.include?(query)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment