Method: VagrantPlugins::ProviderLocal::Provider#ssh_info

Defined in:
lib/vagrant-local/provider.rb

#ssh_infoObject

[View source]

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/vagrant-local/provider.rb', line 24

def ssh_info
  # We just return nil if were not able to identify the VM's IP and
  # let Vagrant core deal with it like docker provider does
  return nil if state.id != :running
  return nil unless driver.get_ip_address

  passwordauth = 'passwordauth'
  ssh_info = {
    host: driver.get_ip_address,
    port: driver.sshport(@machine).to_s,
    password: driver.vagrantuserpass(@machine).to_s,
    username: driver.user(@machine),
    private_key_path: driver.userprivatekeypath(@machine).to_s,
    PasswordAuthentication: passwordauth
  }
  ssh_info unless ssh_info.nil?
end