Hi,

I know that the run function can get access to the host name using the
$CAPISTRANO:HOST$ variable, eg.

  task :peer, :roles => :peer do
     # stuff
     run "some_command $(LC_ALL=C host $CAPISTRANO:HOST$ | awk '/has
address /{print $4}' | head -n 1)"
  end

Is it possible to get access to the same thing within the task itself?

eg. I'd like to do something like:

  task :peer, :roles => :peer do
     # stuff
     require 'resolv'
     host_ip = Resolv::DNS.new.getaddress("$CAPISTRANO:HOST$")
     run "some_command #{host_ip}"
  end

Is that at all possible?

Thanks,

R.
-- 
"Feed that ego and you starve the soul" - Colonel J.D. Wilkes
http://www.theshackshakers.com/

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to