Class: Puppet::NetDev::CE::SshSession

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/provider/ce/session/session.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, username, password) ⇒ SshSession

Returns a new instance of SshSession.



58
59
60
61
62
63
# File 'lib/puppet/provider/ce/session/session.rb', line 58

def initialize(host, username, password)
  @host = host
  @username = username
  @password = password
  @ssh = nil
end

Instance Method Details

#connectObject



65
66
67
68
69
# File 'lib/puppet/provider/ce/session/session.rb', line 65

def connect
  @para = { 'Host' => @host, 'Port' => 22, 'Username' => @username, 'Password' => @password, 'Timeout' => 30, 'Prompt' => /C:.*>/ }
  @ssh = Net::SSH::Telnet.new(@para)
  @ssh
end