improve docs and user experience for setting vagrant bridge

bridge interface can now be overriden using an environment variable
but will try common interface names if not entered.

Change-Id: I11cbac1044dc493ba20a8ae7fb300545c12df73f
This commit is contained in:
Paul Czarkowski 2016-02-07 11:11:32 -06:00
parent 481af2f96a
commit b41e6d6e89
2 changed files with 21 additions and 12 deletions

View File

@ -1,5 +1,18 @@
require 'chef/provisioning'
default_bridge = '["en0: USB Ethernet","en0: Wi-Fi (AirPort)",'
default_bridge += '["en1: USB Ethernet","en1: Wi-Fi (AirPort)",'
default_bridge += '["en2: USB Ethernet","en2: Wi-Fi (AirPort)",'
default_bridge += '["en3: USB Ethernet","en4: USB Ethernet"'
default_bridge += '"eth0","wlan0",'
default_bridge += '"Intel(R) Centrino(R) Advanced-N 6205"]'
if ENV['OS_BRIDGE']
bridge = "\"#{ENV['OS_BRIDGE']}\""
else
bridge = default_bridge
end
controller_config = <<-ENDCONFIG
config.vm.network "forwarded_port", guest: 443, host: 9443
config.vm.network "forwarded_port", guest: 4002, host: 4002
@ -15,15 +28,7 @@ controller_config = <<-ENDCONFIG
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.network "public_network",
bridge: ["en0: USB Ethernet",
"en1: USB Ethernet",
"en2: USB Ethernet",
"en3: USB Ethernet",
"en4: USB Ethernet",
"en0: Wi-Fi (AirPort)",
"en1: Wi-Fi (AirPort)",
"en2: Wi-Fi (AirPort)",
"Intel(R) Centrino(R) Advanced-N 6205"]
bridge: #{bridge}
ENDCONFIG
env = 'allinone-ubuntu14'

View File

@ -8,9 +8,13 @@ Changes need to be made to the allinone.rb file.
### Device interface
The device interface must be is specified by name in the aio-neutron.rb file.
There is one place to change, look for `bridge: [....]`. If your interface is not in the list, add it.
This is because of OVS needing to slurp up an adapter for internet access.
OVS needs to bridge in an adaptor for internet access. An attempt
has been made to work out of the box, however it is quite probable
you'll need to specify the bridge to use. You can set the environment
variable `OS_BRIDGE` before running the vagrant command to set it.
For example on my Ubuntu laptop I run `export OS_BRIDGE=eth0` before
running the rake commands.
Note: To see a list of virtualbox network interface names use:
`$ vboxmanage list bridgedifs`