2013-05-22 22:38:26 +00:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.require_plugin 'vagrant-cachier'
|
2013-07-17 02:20:21 +00:00
|
|
|
Vagrant.require_plugin 'vagrant-librarian-chef'
|
2013-05-22 22:38:26 +00:00
|
|
|
Vagrant.require_plugin 'vagrant-lxc'
|
2013-07-17 02:20:21 +00:00
|
|
|
Vagrant.require_plugin 'vagrant-omnibus'
|
2013-07-19 02:56:42 +00:00
|
|
|
Vagrant.require_plugin 'vagrant-pristine'
|
2013-05-22 22:38:26 +00:00
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
config.vm.synced_folder "../", "/vagrant", id: 'vagrant-root'#, nfs: true
|
|
|
|
|
|
|
|
config.cache.scope = :machine
|
|
|
|
config.cache.auto_detect = true
|
2013-06-11 23:16:06 +00:00
|
|
|
config.cache.enable_nfs = true
|
|
|
|
|
2013-05-22 22:38:26 +00:00
|
|
|
|
2013-07-17 02:20:21 +00:00
|
|
|
config.omnibus.chef_version = :latest
|
|
|
|
config.vm.provision :chef_solo do |chef|
|
|
|
|
chef.add_recipe "java::oracle"
|
|
|
|
chef.json = {
|
|
|
|
:java => {
|
|
|
|
:oracle => {
|
|
|
|
:accept_oracle_download_terms => true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2013-08-15 03:41:59 +00:00
|
|
|
# Installs RVM
|
|
|
|
config.vm.provision :shell, inline: '
|
|
|
|
if ! [ -d /home/vagrant/.rvm ]; then
|
|
|
|
HOME=/home/vagrant su -p vagrant -l -c "curl -L https://get.rvm.io | bash -s stable"
|
|
|
|
fi
|
|
|
|
'
|
|
|
|
|
|
|
|
# Here we have the RVM cache bucket configured, so we install 2.0.0
|
|
|
|
config.vm.provision :shell, inline: '
|
|
|
|
if ! [ -d /home/vagrant/.rvm/rubies/ruby-1.9.3* ]; then
|
|
|
|
HOME=/home/vagrant su -p vagrant -l -c "rvm install 1.9.3 && rvm use 1.9.3 --default"
|
|
|
|
fi
|
|
|
|
'
|
|
|
|
|
2013-10-24 00:11:21 +00:00
|
|
|
config.vm.provision :shell, inline: '
|
|
|
|
if ! [ -d /home/vagrant/.nvm ]; then
|
|
|
|
apt-get install git -y
|
|
|
|
HOME=/home/vagrant su -p vagrant -l -c "
|
|
|
|
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
|
|
|
|
"
|
|
|
|
fi
|
|
|
|
'
|
|
|
|
|
|
|
|
config.vm.provision :shell, inline: '
|
|
|
|
if ! [ -d /home/vagrant/.nvm/v0.10* ]; then
|
|
|
|
HOME=/home/vagrant su -p vagrant -l -c "
|
|
|
|
nvm install 0.10
|
|
|
|
nvm alias default 0.10
|
|
|
|
"
|
|
|
|
fi
|
|
|
|
'
|
|
|
|
|
2013-11-06 21:42:24 +00:00
|
|
|
configure_private_network = lambda do |node, suffix|
|
|
|
|
node.vm.network :private_network, ip: "192.168.50.#{suffix}"
|
|
|
|
end
|
|
|
|
|
2013-05-22 22:38:26 +00:00
|
|
|
debian_like_configs = lambda do |debian|
|
2013-08-15 03:41:59 +00:00
|
|
|
# Here we have the RubyGems cache bucket configured to the right path, so we
|
|
|
|
# bundle the project
|
2013-05-22 22:38:26 +00:00
|
|
|
debian.vm.provision :shell, inline: '
|
2013-10-22 15:51:02 +00:00
|
|
|
sudo apt-get install -y git php5-cli
|
2013-08-15 03:41:59 +00:00
|
|
|
HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"
|
|
|
|
'
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.define :ubuntu do |ubuntu|
|
|
|
|
ubuntu.vm.box = "quantal64"
|
|
|
|
debian_like_configs.call ubuntu
|
2013-11-06 21:42:24 +00:00
|
|
|
configure_private_network.call ubuntu, 10
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
|
2013-09-11 23:47:24 +00:00
|
|
|
config.vm.define :lucid do |lucid|
|
|
|
|
lucid.vm.box = "lucid64"
|
|
|
|
debian_like_configs.call lucid
|
2013-11-06 21:42:24 +00:00
|
|
|
configure_private_network.call lucid, 11
|
2013-09-11 23:47:24 +00:00
|
|
|
end
|
|
|
|
|
2013-05-22 22:38:26 +00:00
|
|
|
config.vm.define :debian do |debian|
|
|
|
|
debian.vm.box = "squeeze64"
|
|
|
|
debian.vm.box_url = 'http://f.willianfernandes.com.br/vagrant-boxes/DebianSqueeze64.box'
|
|
|
|
debian_like_configs.call debian
|
2013-11-06 21:42:24 +00:00
|
|
|
configure_private_network.call debian, 12
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.define :centos do |centos|
|
|
|
|
centos.vm.box = 'centos6_64'
|
|
|
|
centos.vm.box_url = 'http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130309.box'
|
2013-11-06 21:42:24 +00:00
|
|
|
configure_private_network.call centos, 13
|
2013-08-15 03:41:59 +00:00
|
|
|
# Here we have the RubyGems cache bucket configured to the right path, so we
|
|
|
|
# bundle the project
|
2013-05-22 22:38:26 +00:00
|
|
|
centos.vm.provision :shell, inline: '
|
2013-08-15 03:41:59 +00:00
|
|
|
yum install -y libffi-devel ruby-devel git
|
|
|
|
HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"'
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.define :arch do |arch|
|
|
|
|
arch.vm.box = 'arch64'
|
|
|
|
arch.vm.box_url = 'http://vagrant.pouss.in/archlinux_2012-07-02.box'
|
2013-11-06 21:42:24 +00:00
|
|
|
configure_private_network.call arch, 14
|
2013-05-22 22:38:26 +00:00
|
|
|
arch.vm.provision :shell, inline: '
|
2013-08-15 03:41:59 +00:00
|
|
|
pacman -Syu --noconfirm libffi git
|
|
|
|
HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"'
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
2013-11-06 21:44:11 +00:00
|
|
|
|
|
|
|
# Please note that we are not able to install chef on the VM, so when bringing
|
|
|
|
# this up we should always pass in `--provision-with=shell`
|
|
|
|
#
|
|
|
|
# TODO: Find out how to install chef on this or other box or find one that has
|
|
|
|
# it pre installed
|
|
|
|
config.vm.define :opensuse do |suse|
|
|
|
|
suse.vm.box = 'opensuse-12'
|
|
|
|
suse.vm.box_url = 'http://sourceforge.net/projects/opensusevagrant/files/12.3/opensuse-12.3-64.box/download'
|
|
|
|
configure_private_network.call suse, 15
|
|
|
|
suse.cache.enable_nfs = false
|
|
|
|
# This seems to not be working
|
|
|
|
suse.omnibus.chef_version = nil
|
|
|
|
suse.vm.provision :shell, inline: 'time zypper install -y git'
|
|
|
|
end
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|