diff --git a/lib/ey-core/cli/helpers/server_sieve.rb b/lib/ey-core/cli/helpers/server_sieve.rb index 8d142f1..b99e8fc 100644 --- a/lib/ey-core/cli/helpers/server_sieve.rb +++ b/lib/ey-core/cli/helpers/server_sieve.rb @@ -6,6 +6,7 @@ class ServerSieve ROLES = [ :app_servers, :db_servers, + :app_master, :db_master, :utilities ] @@ -56,6 +57,12 @@ def app_servers def db_servers db_master + servers_api.all(role: 'db_slave').to_a end + + def app_master + ['app_master', 'solo']. + map {|role| servers_api.all(role:role).to_a}. + flatten + end def db_master ['db_master', 'solo']. diff --git a/lib/ey-core/cli/ssh.rb b/lib/ey-core/cli/ssh.rb index c2f7d3a..ccf0c5e 100644 --- a/lib/ey-core/cli/ssh.rb +++ b/lib/ey-core/cli/ssh.rb @@ -54,6 +54,10 @@ class Ssh < Subcommand long: "app_servers", description: "Run command on all application servers" + switch :app_master, + long: "app_master", + description: "Run command on app master" + switch :db_servers, long: "db_servers", description: "Run command on all database servers" @@ -97,6 +101,7 @@ def handle environment.servers, all: switch_active?(:all), app_servers: switch_active?(:app_servers), + app_master: switch_active?(:app_master), db_servers: switch_active?(:db_servers), db_master: switch_active?(:db_master), utilities: option(:utilities) @@ -113,6 +118,7 @@ def handle environment.servers, all: switch_active?(:all), app_servers: switch_active?(:app_servers), + app_master: switch_active?(:app_master), db_servers: switch_active?(:db_servers), db_master: switch_active?(:db_master), utilities: option(:utilities)