Skip to content

cannot pass multiple roles to cap tasks #2

@btaitelb

Description

@btaitelb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions