Created
April 17, 2009 13:40
-
-
Save vitaliel/97030 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
# 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