From 889067666b73dfdf9c3475e2248f6e236a4e4476 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 18 Jul 2013 14:59:54 +0900 Subject: [PATCH] pass guest_ip option from config to driver [GH-1121] --- plugins/providers/virtualbox/action/forward_ports.rb | 1 + plugins/providers/virtualbox/model/forwarded_port.rb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/plugins/providers/virtualbox/action/forward_ports.rb b/plugins/providers/virtualbox/action/forward_ports.rb index da4da6eb8..705c0a135 100644 --- a/plugins/providers/virtualbox/action/forward_ports.rb +++ b/plugins/providers/virtualbox/action/forward_ports.rb @@ -69,6 +69,7 @@ module VagrantPlugins # Add the options to the ports array to send to the driver later ports << { :adapter => fp.adapter, + :guestip => fp.guest_ip, :guestport => fp.guest_port, :hostip => fp.host_ip, :hostport => fp.host_port, diff --git a/plugins/providers/virtualbox/model/forwarded_port.rb b/plugins/providers/virtualbox/model/forwarded_port.rb index 5f8e8ed84..4ca81f1e2 100644 --- a/plugins/providers/virtualbox/model/forwarded_port.rb +++ b/plugins/providers/virtualbox/model/forwarded_port.rb @@ -24,6 +24,11 @@ module VagrantPlugins # @return [String] attr_reader :protocol + # The IP that the forwarded port will connect to on the guest machine. + # + # @return [String] + attr_reader :guest_ip + # The port on the guest to be exposed on the host. # # @return [Integer] @@ -48,6 +53,7 @@ module VagrantPlugins @auto_correct = true @auto_correct = options[:auto_correct] if options.has_key?(:auto_correct) @adapter = (options[:adapter] || 1).to_i + @guest_ip = options[:guest_ip] || nil @host_ip = options[:host_ip] || nil @protocol = options[:protocol] || "tcp" end