07687f4401
Create a new VAGRANT_KURYR_RUN_DEVSTACK environment variable to make the `stack.sh` call optional. Some people may want to edit the `local.conf` file before run `stack.sh` manually in the VM. Useful for the devstack/plugin.sh development, for instance. It is defaulted to `true` for backwards compatibility. Change-Id: Ia3fe8cb4416a75a3ec05cbb9ce698313daa555e4
47 lines
1.3 KiB
Ruby
47 lines
1.3 KiB
Ruby
VAGRANTFILE_API_VERSION = "2"
|
|
|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
|
|
VM_MEMORY = ENV.fetch('VAGRANT_KURYR_VM_MEMORY', 4096)
|
|
VM_CPUS = ENV.fetch('VAGRANT_KURYR_VM_CPUS', 2)
|
|
RUN_DEVSTACK = ENV.fetch('VAGRANT_KURYR_RUN_DEVSTACK', 'true')
|
|
|
|
config.vm.hostname = 'devstack'
|
|
|
|
config.vm.provider 'virtualbox' do |v, override|
|
|
override.vm.box = ENV.fetch('VAGRANT_KURYR_VM_BOX', 'trusty')
|
|
v.memory = VM_MEMORY
|
|
v.cpus = VM_CPUS
|
|
end
|
|
|
|
config.vm.provider 'parallels' do |v, override|
|
|
override.vm.box = ENV.fetch('VAGRANT_KURYR_VM_BOX', 'boxcutter/ubuntu1404')
|
|
v.memory = VM_MEMORY
|
|
v.cpus = VM_CPUS
|
|
v.customize ['set', :id, '--nested-virt', 'on']
|
|
end
|
|
|
|
config.vm.provider 'libvirt' do |v, override|
|
|
override.vm.box = ENV.fetch('VAGRANT_KURYR_VM_BOX', 'celebdor/trusty64')
|
|
v.memory = VM_MEMORY
|
|
v.cpus = VM_CPUS
|
|
v.nested = true
|
|
v.graphics_type = 'spice'
|
|
v.video_type = 'qxl'
|
|
end
|
|
|
|
config.vm.synced_folder '../../devstack/', '/devstack'
|
|
# For CentOS machines it needs to be specified
|
|
config.vm.synced_folder '.', '/vagrant'
|
|
|
|
config.vm.provision :shell do |s|
|
|
s.path = 'vagrant.sh'
|
|
s.args = RUN_DEVSTACK
|
|
end
|
|
|
|
if Vagrant.has_plugin?('vagrant-cachier')
|
|
config.cache.scope = :box
|
|
end
|
|
|
|
end
|