1. You simply want the host name to appear somewhere in a command you're running in the current task:
run "echo server is $CAPISTRANO:HOST$"The $CAPISTRANO:HOST$ text gets replaced with the actual hostname immediately before the command is executed on each server.
2. You want to know which servers a task is restricted to:
servers = find_servers_for_task(current_task)
puts "servers: #{servers.join(', ')}"
Hope that helps,
Jamis
On May 16, 2008, at 2:27 PM, Tom Copeland wrote:
Hi all -
I've got a task that needs to know which server it's currently being
executed on. Is there a variable containing this value that the task
can get at? e.g.,
task :foobar, :roles => app do
echo "I'm running on the server #{fetch(:something)}"
end
I could get this info by parsing out `hostname` or something, but was
hoping to avoid that... is there a "current_session" or something?
Thanks,
tom
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---
smime.p7s
Description: S/MIME cryptographic signature
