Class: Flotte::CLI::Host

Inherits:
Thor
  • Object
show all
Includes:
SSHKit::DSL
Defined in:
lib/flotte/cli/host.rb

Instance Method Summary collapse

Instance Method Details

#listObject



7
8
9
10
11
# File 'lib/flotte/cli/host.rb', line 7

def list
  Flotte.registry.hosts.each do |host|
    Flotte.output.puts host.name
  end
end

#ssh(host) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/flotte/cli/host.rb', line 14

def ssh(host)
  host = Flotte.registry.hosts[host]
  command = ["ssh", "-t", host.ssh_destination_string]
  run_locally do
    info "Connecting to host #{host.name} via #{command.join(" ")}"
    Kernel.exec(*command)
  end
end