Created
October 5, 2009 23:07
-
-
Save robinbowes/202587 to your computer and use it in GitHub Desktop.
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
role :counter do | |
enum_counter | |
end | |
task :enum_counter, :roles => [:puppet_masters] do | |
desc "Enumerate hosts that are counter servers from puppet DB" | |
hosts = Hash.new | |
cmd = 'sc_hosts.rb --class site::statcounter::profile::counter' | |
run cmd, :pty => true do |ch, stream, out| | |
next if out.chomp =='' | |
out.split("\r\n").each do |host| | |
role(:counter, host) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment