# -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vms = [ { :id => "debian-jessie-i386", :box => "bento/debian-8.9-i386", }, { :id => "debian-jessie-amd64", :box => "bento/debian-8.9", }, { :id => "debian-stretch-i386", :box => "bento/debian-9.1-i386", }, { :id => "debian-stretch-amd64", :box => "bento/debian-9.1", }, ] vms.each do |vm| config.vm.define(vm[:id]) do |node| # Use official box node.vm.box = vm[:box] if vm[:box] # Use box and box_url until official box is released node.vm.box = vm[:id] if vm[:box_url] node.vm.box_url = vm[:box_url] if vm[:box_url] node.vm.provision(:shell, :path => "build-deb.sh") node.vm.provider("virtualbox") do |virtual_box| system_n_cpus = 1 if File.exist?("/proc/cpuinfo") system_n_cpus = File.readlines("/proc/cpuinfo").grep(/^processor/).size end if system_n_cpus > 1 vm_n_cpus = system_n_cpus / 2 else vm_n_cpus = 1 end virtual_box.cpus = (ENV["VM_CPUS"] || vm_n_cpus).to_i virtual_box.memory = (ENV["VM_MEMORY"] || 768).to_i end end end end