VOL-526 add parameter to support setting the vagrant box name
Change-Id: I6eb7d526a22d3c221f043d7d3e4d5f769b3f84a2
diff --git a/Vagrantfile b/Vagrantfile
index 843b7be..ab1104b 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -16,19 +16,31 @@
if /cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM
puts("Configuring for windows")
config.vm.synced_folder "../..", "/cord", mount_options: ["dmode=700,fmode=600"]
- Box = "ubuntu/xenial64"
+ if settings['vagrant_box']
+ Box = settings['vagrant_box']
+ else
+ Box = "ubuntu/xenial64"
+ end
Provider = "virtualbox"
elsif RUBY_PLATFORM =~ /linux/
puts("Configuring for linux")
if settings['vProvider'] == "virtualbox"
puts("Using the virtualbox configuration");
config.vm.synced_folder "../..", "/cord"
- Box = "ubuntu/xenial64"
+ if settings['vagrant_box']
+ Box = settings['vagrant_box']
+ else
+ Box = "ubuntu/xenial64"
+ end
Provider = "virtualbox"
config.disksize.size = '50GB'
else
puts("Using the QEMU/KVM configuration");
- Box = "elastic/ubuntu-16.04-x86_64"
+ if settings['vagrant_box']
+ Box = settings['vagrant_box']
+ else
+ Box = "ubuntu1604"
+ end
Provider = "libvirt"
if settings['testMode'] == "true" or settings['installMode'] == "true"
config.vm.synced_folder ".", "/vagrant", disabled: true
@@ -41,7 +53,11 @@
else
puts("Configuring for other")
config.vm.synced_folder "../..", "/cord"
- Box = "ubuntu/xenial64"
+ if settings['vagrant_box']
+ Box = settings['vagrant_box']
+ else
+ Box = "ubuntu/xenial64"
+ end
Provider = "virtualbox"
config.disksize.size = '50GB'
end
@@ -49,8 +65,10 @@
config.vm.define "#{settings['server_name']}" do |d|
d.ssh.forward_agent = true
d.vm.box = Box
- if Box == "ubuntu/xenial64"
- d.vm.box_version = "20170207.0.0"
+ if settings['vagrant_box_version']
+ d.vm.box_version = settings['vagrant_box_version']
+ elsif Box == "ubuntu/xenial64"
+ d.vm.box_version = "20170207.0.0"
end
d.vm.hostname = "#{settings['server_name']}"
d.vm.network "private_network", ip: "10.100.198.220"
diff --git a/settings.vagrant.nightly.yaml b/settings.vagrant.nightly.yaml
index 10ab061..deb604f 100644
--- a/settings.vagrant.nightly.yaml
+++ b/settings.vagrant.nightly.yaml
@@ -3,6 +3,7 @@
server_name: "voltha"
# Use KVM for nightly build
vProvider: "KVM"
+vagrant_box: "elastic/ubuntu-16.04-x86_64"
# This determines if test mode is active
testMode: "false"
# This determines if installer mode is active
diff --git a/settings.vagrant.yaml b/settings.vagrant.yaml
index 0bfc1d4..7df64d2 100644
--- a/settings.vagrant.yaml
+++ b/settings.vagrant.yaml
@@ -3,6 +3,7 @@
server_name: "voltha"
# Use virtualbox for development
vProvider: "virtualbox"
+#vagrant_box: "ubuntu/xenial64"
# This determines if test mode is active
testMode: "false"
# This determines if installer mode is active