for libvirt provider use rync to work around mount issue
Change-Id: Ic903938dc07592a7a5ffc0481a6e7f9e066bfb07
diff --git a/Vagrantfile b/Vagrantfile
index b02e72e..2485701 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -1,6 +1,14 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
+# Look at the command line arguments and the environment to
+# determine the provider being used
+if ARGV[1] and (ARGV[1].split('=')[0] == "--provider" or ARGV[2])
+ provider = (ARGV[1].split('=')[1] || ARGV[2])
+else
+ provider = (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym
+end
+
Vagrant.configure(2) do |config|
if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
@@ -14,15 +22,20 @@
d.vm.box = "ubuntu/trusty64"
d.vm.hostname = "corddev"
d.vm.network "private_network", ip: "10.100.198.200"
- d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
- d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
+ #d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
+ #d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
d.vm.provider "virtualbox" do |v|
v.memory = 2048
end
- d.vm.provider :libvirt do |domain|
+
+ # The libvirt provider is not handling mounts "normally", so for now get the source into the VM
+ # via an rsync
+ if provider == "libvirt"
d.vm.synced_folder '../', '/cord', type: 'rsync', rsync__args: ["--verbose", "--archive", "--delete", "-z"]
d.vm.synced_folder '.', '/vagrant', type: 'rsync', disabled: true
- domain.memory = 2048
+ d.vm.provider :libvirt do |domain|
+ domain.memory = 2048
+ end
end
end
@@ -69,7 +82,7 @@
lxc.customize 'cgroup.devices.allow', 'b 7:* rwm'
lxc.customize 'cgroup.devices.allow', 'c 10:237 rwm'
end
- end
+ end
(1..3).each do |i|
# Defining VM properties