Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot pass multiple roles to cap tasks #2

Open
btaitelb opened this issue Jul 13, 2012 · 1 comment
Open

cannot pass multiple roles to cap tasks #2

btaitelb opened this issue Jul 13, 2012 · 1 comment

Comments

@btaitelb
Copy link

I have the following ec2 setup:

server-1 Tag: Roles => "app"
server-2 Tag: Roles => "solr"

And have put the following in my config/deploy.rb:

cloud_roles :app, :solr

But when I execute the following command, capistrano only connects to the solr instance, not to both:

cap app solr shell
  * 16:10:56 == Currently executing `app'
  * 16:10:56 == Currently executing `solr'
  * 16:10:56 == Currently executing `shell'
cap> date
[establishing connection(s) to <server2-ip>]

Similarly, when I reverse the order (cap solr app shell), it connects to server-1, so it appears that the roles are overwriting each other rather than being additive.

As a workaround, I can use the following config:

cloud_roles :name => :app, :options=>{ :default => true }
cloud_roles :name => :solr, :options=>{ :default => true }

And then simply calling cap shell works as desired, but the documentation describing this configuration has a warning about this not working with load balancers, so I'm not sure if this is the correct approach.

@jmonteiro
Copy link

Great catch. I believe that the :options => { :default => true } should be set to all cloud_roles, so capify-cloud would be a drop-in gem for avoiding manually writing roles on your Capistrano configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants