Class: VagrantPlugins::Proxmox::Action::ReadSSHInfo

Inherits:
ProxmoxAction
  • Object
show all
Defined in:
lib/vagrant-proxmox/action/read_ssh_info.rb

Overview

This action stores the ssh information in env

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ ReadSSHInfo

Returns a new instance of ReadSSHInfo.



8
9
10
11
# File 'lib/vagrant-proxmox/action/read_ssh_info.rb', line 8

def initialize app, env
	@app = app
	@logger = Log4r::Logger.new 'vagrant_proxmox::action::read_ssh_info'
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/vagrant-proxmox/action/read_ssh_info.rb', line 13

def call env
	env[:machine_ssh_info] = get_machine_ip_address(env).try do |ip_address|
		{host: ip_address, port: env[:machine].config.ssh.guest_port}
	end
	env[:machine_ssh_info]
	next_action env
end