Class: Puppet::NetDev::CE::Device_ssh
- Inherits:
- 
      Object
      
        - Object
- Puppet::NetDev::CE::Device_ssh
 
- Defined in:
- lib/puppet/provider/ce/device_ssh/device_ssh.rb
Constant Summary collapse
- @@ssh_session =
- nil
- @@command_ssh_api =
- nil
- @@ssh_hostip =
- nil
- @@ssh_username =
- nil
- @@ssh_password =
- nil
Class Method Summary collapse
- 
  
    
      .command_ssh_api  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    create Command_sshApi instance. 
- .ssh_instance(ssh_ipaddress, ssh_username, ssh_password) ⇒ Object
- .ssh_session ⇒ Object
Class Method Details
.command_ssh_api ⇒ Object
create Command_sshApi instance
| 52 53 54 55 | # File 'lib/puppet/provider/ce/device_ssh/device_ssh.rb', line 52 def self.command_ssh_api @@command_ssh_api = Command_sshApi.new if nil == @@command_ssh_api @@command_ssh_api end | 
.ssh_instance(ssh_ipaddress, ssh_username, ssh_password) ⇒ Object
| 45 46 47 48 49 | # File 'lib/puppet/provider/ce/device_ssh/device_ssh.rb', line 45 def self.ssh_instance(ssh_ipaddress, ssh_username, ssh_password) @@ssh_hostip = ssh_ipaddress @@ssh_username = ssh_username @@ssh_password = ssh_password end | 
.ssh_session ⇒ Object
| 33 34 35 36 37 38 39 40 41 42 43 | # File 'lib/puppet/provider/ce/device_ssh/device_ssh.rb', line 33 def self.ssh_session if nil == @@ssh_session && nil != @@ssh_hostip && nil != @@ssh_username && nil != @@ssh_password ssh_session = Puppet::NetDev::CE::SshSession.new(@@ssh_hostip, @@ssh_username, @@ssh_password) @@ssh_session = ssh_session.connect puts 'create ssh session in normal way' end @@ssh_session end |