aboutsummaryrefslogtreecommitdiff
path: root/contrib/dev/vagrant/Vagrantfile
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dev/vagrant/Vagrantfile')
-rw-r--r--contrib/dev/vagrant/Vagrantfile28
1 files changed, 22 insertions, 6 deletions
diff --git a/contrib/dev/vagrant/Vagrantfile b/contrib/dev/vagrant/Vagrantfile
index a667aa086..3088e2126 100644
--- a/contrib/dev/vagrant/Vagrantfile
+++ b/contrib/dev/vagrant/Vagrantfile
@@ -15,6 +15,11 @@ end
vagrant_dir = File.expand_path(File.dirname(__FILE__))
+# get kolla and kolla-ansibe repos path relative to current directory
+# they will be used by the bootstrap script to configure the nodes
+kolla_ansible_repo_path = File.expand_path(File.join(vagrant_dir, '..', '..', '..'))
+kolla_repo_path = File.expand_path(File.join(vagrant_dir, '..', '..', '..', '..', 'kolla'))
+
# Vagrantfile.custom contains user customization for the Vagrantfile
# You shouldn't have to edit the Vagrantfile, ever.
if File.exists?(File.join(vagrant_dir, 'Vagrantfile.custom'))
@@ -42,7 +47,8 @@ PROVIDER_DEFAULTS ||= {
bridge_interface: "virbr0",
vagrant_shared_folder: "/home/vagrant/sync",
sync_method: "nfs",
- kolla_path: "/home/vagrant/kolla"
+ kolla_path: "/home/vagrant/kolla",
+ kolla_ansible_path: "/home/vagrant/kolla-ansible"
}
},
virtualbox: {
@@ -51,14 +57,16 @@ PROVIDER_DEFAULTS ||= {
bridge_interface: "wlp3s0b1",
vagrant_shared_folder: "/home/vagrant/sync",
sync_method: "virtualbox",
- kolla_path: "/home/vagrant/kolla"
+ kolla_path: "/home/vagrant/kolla",
+ kolla_ansible_path: "/home/vagrant/kolla-ansible"
},
ubuntu: {
base_image: "ubuntu/wily64",
bridge_interface: "wlp3s0b1",
vagrant_shared_folder: "/home/vagrant/sync",
sync_method: "virtualbox",
- kolla_path: "/home/vagrant/kolla"
+ kolla_path: "/home/vagrant/kolla",
+ kolla_ansible_path: "/home/vagrant/kolla-ansible"
}
}
}
@@ -159,6 +167,13 @@ def configure_wifi_if_enabled(vm)
end
Vagrant.configure(2) do |config|
+
+ # check for kolla repo to be available
+ unless File.directory?(kolla_repo_path)
+ raise VagrantConfigMissing,
+ "Missing kolla repository checkout at #{kolla_repo_path}"
+ end
+
config.vm.box = get_default(:base_image)
# Next to the hostonly NAT-network there is a host-only network with all
@@ -209,8 +224,9 @@ Vagrant.configure(2) do |config|
# The operator controls the deployment
config.vm.define "operator", primary: true do |admin|
admin.vm.hostname = "operator.local"
- admin.vm.provision :shell, path: PROVISION_SCRIPT, args: "operator #{MULTINODE ? 'multinode' : 'aio'} #{get_default(:kolla_path)}"
- admin.vm.synced_folder File.join(vagrant_dir, '..', '..', '..'), get_default(:kolla_path), create:"True", type: get_default(:sync_method)
+ admin.vm.provision :shell, path: PROVISION_SCRIPT, args: "operator #{MULTINODE ? 'multinode' : 'aio'} #{get_default(:kolla_path)} #{get_default(:kolla_ansible_path)}"
+ admin.vm.synced_folder kolla_ansible_repo_path, get_default(:kolla_ansible_path), create:"True", type: get_default(:sync_method)
+ admin.vm.synced_folder kolla_repo_path, get_default(:kolla_path), create:"True", type: get_default(:sync_method)
admin.vm.synced_folder File.join(vagrant_dir, 'storage', 'operator'), "/data/host", create:"True", type: get_default(:sync_method)
admin.vm.synced_folder File.join(vagrant_dir, 'storage', 'shared'), "/data/shared", create:"True", type: get_default(:sync_method)
admin.vm.synced_folder ".", get_default(:vagrant_shared_folder), disabled: true
@@ -231,7 +247,7 @@ Vagrant.configure(2) do |config|
hostname = "#{node_type}0#{i}"
config.vm.define hostname do |node|
node.vm.hostname = "#{hostname}.local"
- node.vm.provision :shell, path: PROVISION_SCRIPT, args: "#{hostname} multinode #{get_default(:kolla_path)}"
+ node.vm.provision :shell, path: PROVISION_SCRIPT, args: "#{hostname} multinode #{get_default(:kolla_path)} #{get_default(:kolla_ansible_path)}"
node.vm.synced_folder File.join(vagrant_dir, 'storage', node_type), "/data/host", create:"True", type: get_default(:sync_method)
node.vm.synced_folder File.join(vagrant_dir, 'storage', 'shared'), "/data/shared", create:"True", type: get_default(:sync_method)
node.vm.synced_folder ".", get_default(:vagrant_shared_folder), disabled: true