Skip to content

Instantly share code, notes, and snippets.

@vitaliel
Created April 17, 2009 13:40
Show Gist options
  • Save vitaliel/97030 to your computer and use it in GitHub Desktop.
Save vitaliel/97030 to your computer and use it in GitHub Desktop.
# build server role map
task :test_me, :roles => :web do |t|
srv_roles = {}
for role, values in t.roles
values.map do |s|
srv_roles[s.host] ||= []
srv_roles[s.host] << role
end
end
p srv_roles
# exit 1
cmd = "echo 1"
block ||= self.class.default_io_proc
execute_on_servers do |servers|
p servers
servers.map {|s| p s}
targets = servers.map { |s| sessions[s] }
#p targets
Command.process(cmd, targets, options.merge(:logger => logger), &block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment