# -*- 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 => "centos-6-i386", :box => "bento/centos-6.9-i386", }, { :id => "centos-6-x86_64", :box => "bento/centos-6.9", }, { :id => "centos-7-x86_64", :box => "bento/centos-7.4", }, ] vms.each do |vm| config.vm.define(vm[:id]) do |node| node.vm.box = vm[:box] node.vm.provision(:shell, :path => "build-rpm.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 = vm_n_cpus virtual_box.memory = (ENV["VM_MEMORY"] || 1024).to_i end end end end