Class: Kitchen::Driver::Ssh

Inherits:
SSHBase
  • Object
show all
Defined in:
lib/kitchen/driver/ssh.rb

Instance Method Summary collapse

Instance Method Details

#create(state) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kitchen/driver/ssh.rb', line 7

def create(state)
  state[:sudo] = config[:sudo]
  state[:port] = config[:port]
  state[:ssh_key] = config[:ssh_key]
  state[:forward_agent] = config[:forward_agent]
  state[:username] = config[:username]
  state[:hostname] = config[:hostname]
  state[:password] = config[:password]
  print "Kitchen-ssh does not start your server '#{state[:hostname]}' but will look for an ssh connection with user '#{state[:username]}'"
  wait_for_sshd(state[:hostname], state[:username], {:port => state[:port]})
  print "Kitchen-ssh found ssh ready on host '#{state[:hostname]}' with user '#{state[:username]}'\n"
  debug("ssh:create '#{state[:hostname]}'")
end

#destroy(state) ⇒ Object



21
22
23
24
25
26
# File 'lib/kitchen/driver/ssh.rb', line 21

def destroy(state)
  print "Kitchen-ssh does not destroy your server '#{state[:hostname]}' by shutting it down..."
  print "Shutdown your server '#{state[:hostname]}' natively with user '#{state[:username]}'"
  print 'in your cloud or virtualisation console etc.\n'
  debug("ssh:destroy '#{state[:hostname]}'")
end