27711777d6
Explicitly set type for integer environment variables: * VAGRANT_KURYR_VM_MEMORY * VAGRANT_KURYR_VM_CPUS Despite there is a fix in the Vagrant git repo for that issue, still exist systems where the issue is not fixed. On those systems trying to limit the VM memory one will get «no implicit conversion of String into Integer». Thus convert the environment variables to int explicitly. Change-Id: I80a39e0b072159b601dd8cadf839e596ea64e644 Bug-Url: https://github.com/vagrant-libvirt/vagrant-libvirt/issues/525 Bug-Url: https://github.com/vagrant-libvirt/vagrant-libvirt/pull/526
48 lines
1.4 KiB
Ruby
48 lines
1.4 KiB
Ruby
VAGRANTFILE_API_VERSION = "2"
|
|
|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
|
|
VM_MEMORY = ENV.fetch('VAGRANT_KURYR_VM_MEMORY', 6144).to_i
|
|
VM_CPUS = ENV.fetch('VAGRANT_KURYR_VM_CPUS', 2).to_i
|
|
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', 'ubuntu/trusty64')
|
|
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
|
|
|
|
config.vm.network :forwarded_port, guest: 80, host_ip: "127.0.0.1", host: 8080
|
|
end
|