Thanks for response.

I read documentation from a to z before writing here :) as I wrote
previously in my example you can see ":hosts" variable are defined,
but at this step it is ignored and Capture() picks ip from shell.

So maybe :hosts variable is ignored or not overwriting host when you
executing task from shell for some host ("on host !...")?

On Dec 15, 12:16 pm, Lee Hambley <lee.hamb...@gmail.com> wrote:
> Please see the API documentation for Capture():
>
> http://rubydoc.info/github/capistrano/capistrano/master/Capistrano/Co...
>
> And, perhaps more usefullly:
>
> http://rubydoc.info/github/capistrano/capistrano/master/Capistrano/Co...
>
> Where you end up, eventually - notice the option list for run().
>
> - Lee
>
> On 15 December 2011 09:54, Aurimas Sabaitis <aurimas.sabai...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > Is there any way to force host in capture command when it executed
> > from task
>
> > Basically I need:
>
> > task :aaa do
>
> >   # Get variable from other host
> >   remote_var = capture("echo $xxx", :hosts=>"192.168.0.1")
>
> >   # Set to current host
> >   run("echo #{remote_var} > some_file")
>
> > end
>
> > And I executing task from capistrano shell:
>
> >   cap> on 192.168.0.2 !namespace:aaa
>
> > --
> > * You received this message because you are subscribed to the Google
> > Groups "Capistrano" group.
> > * To post to this group, send email to capistrano@googlegroups.com
> > * To unsubscribe from this group, send email to
> > capistrano+unsubscr...@googlegroups.com For more options, visit this
> > group athttp://groups.google.com/group/capistrano?hl=en

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

Reply via email to