Created
August 7, 2012 05:43
-
-
Save ejhayes/3282051 to your computer and use it in GitHub Desktop.
Rake API for Puppet Dashboard - includes functionality to search for nodes that contain a class
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
task :hasclass => :environment do | |
class_name = false | |
if ENV['class'] | |
class_name = ENV['class'] | |
end | |
NodeClassMembership.find(:all, :include => [:node_class],:conditions => { | |
:node_classes => { :name => class_name } | |
}).each do |node| | |
puts node.node.name | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment