Class: VagrantPlugins::ProviderIijGp::Action::ReadSSHInfo
- Inherits:
-
Object
- Object
- VagrantPlugins::ProviderIijGp::Action::ReadSSHInfo
- Defined in:
- lib/vagrant-iijgp/action/read_ssh_info.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ ReadSSHInfo
constructor
A new instance of ReadSSHInfo.
- #read_ssh_info(cli, machine) ⇒ Object
Constructor Details
#initialize(app, env) ⇒ ReadSSHInfo
Returns a new instance of ReadSSHInfo.
5 6 7 8 |
# File 'lib/vagrant-iijgp/action/read_ssh_info.rb', line 5 def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_iijgp::action::read_ssh_info") end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 |
# File 'lib/vagrant-iijgp/action/read_ssh_info.rb', line 10 def call(env) env[:machine_ssh_info] = read_ssh_info(env[:iijapi], env[:machine]) @app.call(env) end |
#read_ssh_info(cli, machine) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/vagrant-iijgp/action/read_ssh_info.rb', line 16 def read_ssh_info(cli, machine) vm = cli.gp(machine.provider_config.gp_service_code).gc(machine.id) { :host => vm.info['GlobalAddress']['IPv4Address'], :port => 22 } end |