Hello Donovan

Thank you very much! That has worked perfectly.


On 11月11日, 午後11:25, Donovan Bray <[email protected]> wrote:
> tasks do not cascade inheritance, so your shared_task will run on all
> servers since that task isn't restricted to a role.
>
> you can however define shared_task as a method instead of a task, and then
> it will use the calling tasks scope.
>
> ie:
>
> def shared_task
>   run "hostname"
> end
>
> and keep the rest the same.
>
>
>
>
>
>
>
> On Fri, Nov 11, 2011 at 6:06 AM, hiroysato <[email protected]> wrote:
> > Dear members.
>
> > Is it possible to share one task from multiple roles??
>
> > If I execute ``cap login_server'',
> > I would like to execute shared_task on role of servers.
>
> > But the folowing Capfile is executed login_server task on server and
> > client.
>
> > Sincerely.
>
> > --------------------------------------------------------------------------- 
> > -----
> > role :servers, "foo"
> > role :clients, "bar"
>
> > #
> > # for server task
> > #
> > task :login_server, :roles => :servers do
> >  set :variable_prameters, "for_server"
> >  shared_task
> > end
>
> > #
> > # for client task
> > #
> > task :login_client, :roles => :clients do
> >  set :variable_prameters, "for_client"
> >  shrared_task
> > end
>
> > #
> > # shared_task
> > #
> > task :shared_task do
> >    run "hostname"
> > end
>
> > --------------------------------------------------------------------------- 
> > -----
>
> > --
> > Hiroyuki Sato
>
> > --
> > * 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 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 [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