The following code in a capfile will result in the command being run in 
["localhost","otherhost"]

role :db, "localhost"

task :role_test, :roles=>:db do
  role :db, "otherhost"
  run("ls")
end

I would like to be able to completely redefine the role programmatically 
(instead of just adding servers to the role). This would be easy if we 
changed the attr_reader to attr_accessor on line 14 of 
capistrano/configuration/roles.rb (talking cap 2.1.0 here).
Or provide a Capistrano::Configuration::Roles::clear_role method

def clear_role(which)
    roles[which]=[]
end

This is my solution X to my problem Y:

A small scenario:

There is an "application server package" and a "database package". We 
can deploy these on 2 separate machines, so one machine fulfils the 
application server role and the other the database role. Or, we can do 
an all-in-one deployment where a single server fulfils both roles.
In this particular scenario it is not desirable to do the deployment on 
both machines - we'd like to control which server subset is used for the 
role through other means .

I can solve this problem by simply not calling role outside of the 
tasks, but I would like a bit more control.
Would that be possible?
Cheers,
V.-

---
http://www.braveworld.net/riva

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

Reply via email to