Those parameters don't get added to the role, but to each individual server defined by that role declaration. If you want it, you'll need to get the list of servers that match, but then you'll still need to figure out which one of the :foo's you want, since you'll have multiple servers which may or may not share the same key/value.

  servers = find_servers_by_task(current_task)
  foos = servers.map { |server| server.options[:foo] }
  puts "found #{foos.length} foo values:"
  foos.each { |f| puts(f) }

- Jamis

On Apr 30, 2008, at 9:11 AM, [EMAIL PROTECTED] wrote:


First i have to say that im not familiar with ruby so perhaps this is
a dumb question but i didn't found any solution for my problem even
after overlooking ruby syntax:

Lets say i add a custom parameter to my role like in this example

role :myrole1,  "[EMAIL PROTECTED]", :foo=>"bar"

Is it possible to access this extra parameter in my task like::

task :mytest, :roles => :myrole1
   run "echo #{foo}"
end

Thanx in Advance

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to