Skip to content

Instantly share code, notes, and snippets.

@robinbowes
Created October 5, 2009 23:07
Show Gist options
  • Save robinbowes/202587 to your computer and use it in GitHub Desktop.
Save robinbowes/202587 to your computer and use it in GitHub Desktop.
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