diff options
author | Aurélien Degeorges <aurelien.degeorges@6wind.com> | 2016-06-06 13:49:52 +0200 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2016-06-09 02:13:03 +0000 |
commit | c1bec35f1657de95d32e0646761e06133e594b51 (patch) | |
tree | 10a02c5e433f2ffc71854055dc6ab5a7f2c31129 | |
parent | e8c787b699661f00e8358cc711bb20b8993dc87a (diff) |
Fix Vagrant config for multi-user environment
Add support for an environment variable "VPP_VAGRANT_NET_PREFIX" to add a prefix
before the name of vbox internal networks.
Otherwise two users trying to do "vargrant up" on the same server will face
conflicts with the name of vbox internal networks.
Change-Id: I5ba7c06fe111944fcac3da25276d018d281aef4f
Signed-off-by: Aurélien Degeorges <aurelien.degeorges@6wind.com>
-rw-r--r-- | resources/tools/vagrant/Vagrantfile | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/resources/tools/vagrant/Vagrantfile b/resources/tools/vagrant/Vagrantfile index f73ca5b76f..46e214693d 100644 --- a/resources/tools/vagrant/Vagrantfile +++ b/resources/tools/vagrant/Vagrantfile @@ -63,6 +63,11 @@ def add_dut(config, name, mgmt_ip, net1, net2) end +net_prefix = '' +if ENV.key?('VPP_VAGRANT_NET_PREFIX') + net_prefix = ENV['VPP_VAGRANT_NET_PREFIX'] + '_' +end + Vagrant.configure(2) do |config| config.vm.box_check_update = false config.vm.define "tg" do |tg| @@ -84,9 +89,9 @@ Vagrant.configure(2) do |config| tg.vm.provision "shell", inline: $install_prereqs tg.vm.network "private_network", ip: '192.168.255.100/24' tg.vm.network "private_network", type: "dhcp", auto_config: false, - virtualbox__intnet: "tg_dut1" + virtualbox__intnet: net_prefix + "tg_dut1" tg.vm.network "private_network", type: "dhcp", auto_config: false, - virtualbox__intnet: "tg_dut2" + virtualbox__intnet: net_prefix + "tg_dut2" tg.vm.provider "virtualbox" do |vb| vb.memory = "2048" vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] @@ -95,7 +100,7 @@ Vagrant.configure(2) do |config| end - add_dut(config, "dut1", "192.168.255.101/24", "tg_dut1", "dut1_dut2") - add_dut(config, "dut2", "192.168.255.102/24", "tg_dut2", "dut1_dut2") + add_dut(config, "dut1", "192.168.255.101/24", net_prefix + "tg_dut1", net_prefix + "dut1_dut2") + add_dut(config, "dut2", "192.168.255.102/24", net_prefix + "tg_dut2", net_prefix + "dut1_dut2") end |