Method: ConfCtl::Cli::Cluster#cssh

Defined in:
lib/confctl/cli/cluster.rb

#csshObject



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/confctl/cli/cluster.rb', line 300

def cssh
  machines = select_machines_with_managed(args[0]).runnable
  raise 'No machines to open cssh to' if machines.empty?

  ask_confirmation! do
    puts 'Open cssh to the following machines:'
    list_machines(machines)
  end

  nix = ConfCtl::Nix.new

  cssh = [
    'cssh',
    '-l', 'root'
  ]

  machines.each_value do |machine|
    cssh << machine.target_host
  end

  nix.run_command_in_shell(
    packages: ['perlPackages.AppClusterSSH'],
    command: cssh.join(' ')
  )
end