Almost!

Seems that primary returns a Capistrano::Configuration::Server and not an 
enumerable (at least in 3.4.0) so that hack do not work. But it helped me 
to reach

on (roles(:app) - [primary(:app)]) do

which work as expected

see:

[4] pry(main)> primary(:app)
=> #<Capistrano::Configuration::Server:0x007f2a421d3ee0
 @hostname="127.0.0.1",
 @port=nil,
 @properties=#<Capistrano::Configuration::Server::Properties:0x007f2a421d3a58 
@properties={}, @roles=#<Set: {:app}>>,
 @user="carlos">
[5] pry(main)> roles(:app) - [primary(:app)]

=> [#<Capistrano::Configuration::Server:0x007f2a421d38f0
  @hostname="127.0.1.1",
  @port=nil,
  @properties=#<Capistrano::Configuration::Server::Properties:0x007f2a421d35a8 
@properties={}, @roles=#<Set: {:app}>>,
  @user="carlos">,
 #<Capistrano::Configuration::Server:0x007f2a421d3440
  @hostname="127.1.0.1",
  @port=nil,
  @properties=#<Capistrano::Configuration::Server::Properties:0x007f2a421d30f8 
@properties={}, @roles=#<Set: {:app}>>,
  @user="carlos">,
 #<Capistrano::Configuration::Server:0x007f2a421d2f40
  @hostname="127.1.1.1",
  @port=nil,
  @properties=#<Capistrano::Configuration::Server::Properties:0x007f2a421d2bd0 
@properties={}, @roles=#<Set: {:app}>>,
  @user="carlos">]




On Tuesday, 3 March 2015 14:28:49 UTC+1, Lee Hambley wrote:
>
> try (roles(:role) - primary(:role)), they are Ruby enumerables, so it 
> might work :)
>
> Lee Hambley
> http://lee.hambley.name/
> +49 (0) 170 298 5667
>
> On 3 March 2015 at 13:30, Carlos Peñas <carlos...@the-cocktail.com 
> <javascript:>> wrote:
>
>> on capistrano V3 there's:
>>
>> roles(:role) For all servers
>> and
>> primary(:role) for the first server in a role
>>
>> Is there a way to refer "the servers which aren't primary" in a similar 
>> way? Or I am forced to use server properties?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to capistrano+...@googlegroups.com <javascript:>.
>> To view this discussion on the web, visit 
>> https://groups.google.com/d/msgid/capistrano/ae113948-8f27-41f4-a2db-d6f5754af8cd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/capistrano/ae113948-8f27-41f4-a2db-d6f5754af8cd%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/942aa0a4-173e-4801-8bb5-9c946d52eb08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to