From 3cda2e48dcf0f7c668e2d6c97f1f8bdd78be8b72 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 24 Jan 2012 21:29:26 -0800 Subject: [PATCH] Setting :auto_config to false will not configure a network. [GH-663] --- CHANGELOG.md | 2 ++ lib/vagrant/action/vm/network.rb | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d615f41c9..1f53e074f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ - Match VM names that have parens, brackets, etc. - Detect when the VirtualBox kernel module is not loaded and error. [GH-677] + - Set `:auto_config` to false on any networking option to not automatically + configure it on the guest. [GH-663] ## 0.9.3 (January 24, 2012) diff --git a/lib/vagrant/action/vm/network.rb b/lib/vagrant/action/vm/network.rb index f6520afb9..122802027 100644 --- a/lib/vagrant/action/vm/network.rb +++ b/lib/vagrant/action/vm/network.rb @@ -37,8 +37,12 @@ module Vagrant adapters << adapter # Get the network configuration - network = send("#{type}_network_config", config) - networks << network + if config[:auto_config] + network = send("#{type}_network_config", config) + networks << network + else + @logger.info("Auto config disabled, not configuring: #{type}") + end end if !adapters.empty? @@ -167,7 +171,8 @@ module Vagrant :netmask => "255.255.255.0", :adapter => nil, :mac => nil, - :name => nil + :name => nil, + :auto_config => true }.merge(options) # Verify that this hostonly network wouldn't conflict with any @@ -307,7 +312,8 @@ module Vagrant return { :adapter => nil, - :mac => nil + :mac => nil, + :auto_config => true }.merge(options) end