Class: Yun::YunCommand

Inherits:
Thor
  • Object
show all
Includes:
CommandBase
Defined in:
lib/yun/commands/yun_command.rb

Instance Method Summary collapse

Methods included from CommandBase

#connection, #init_data

Instance Method Details

#ssh(node_name) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/yun/commands/yun_command.rb', line 12

def ssh node_name
  key = "~/.ssh/#{Config.key_name}.pem"
  user_name = "ec2-user"

  node = connection.find node_name
  server_ip = node.ip

  exec "ssh -i #{key} #{user_name}@#{server_ip}"
end