diff options
Diffstat (limited to 'storage/mroonga/packages/yum/Vagrantfile')
-rw-r--r-- | storage/mroonga/packages/yum/Vagrantfile | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/storage/mroonga/packages/yum/Vagrantfile b/storage/mroonga/packages/yum/Vagrantfile new file mode 100644 index 00000000000..aeee1ceb5b2 --- /dev/null +++ b/storage/mroonga/packages/yum/Vagrantfile @@ -0,0 +1,50 @@ +# -*- 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-5-i386", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10-i386_chef-provisionerless.box", + }, + { + :id => "centos-5-x86_64", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10_chef-provisionerless.box", + }, + { + :id => "centos-6-i386", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5-i386_chef-provisionerless.box", + }, + { + :id => "centos-6-x86_64", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box", + }, + { + :id => "centos-7-x86_64", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box", + }, + ] + + vms.each do |vm| + config.vm.define(vm[:id]) do |node| + node.vm.box = vm[:id] + node.vm.box_url = vm[:box_url] + 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 + end + end + end +end |