Module: Vagabond::Actions::SSH

Defined in:
lib/vagabond/actions/ssh.rb

Instance Method Summary collapse

Instance Method Details

#_sshObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/vagabond/actions/ssh.rb', line 4

def _ssh
  name_required!
  if(lxc.exists?)
    if(lxc.running?)
      ui.info "#{ui.color('Vagabond:', :bold)} SSH connect to: #{ui.color(name, :cyan)}"
      exec("#{options[:sudo]}ssh root@#{lxc.container_ip(10, true)} -i /opt/hw-lxc-config/id_rsa -oStrictHostKeyChecking=no")
    else
      ui.error "Node not running: #{name}"
    end
  else
    ui.error "Node not created: #{name}"
  end
end