vagrant-cachier-ng/development/Vagrantfile

138 lines
4.2 KiB
Text
Raw Permalink Normal View History

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_plugin 'vagrant-cachier'
Vagrant.require_plugin 'vagrant-librarian-chef'
Vagrant.require_plugin 'vagrant-lxc'
Vagrant.require_plugin 'vagrant-omnibus'
Vagrant.require_plugin 'vagrant-pristine'
Vagrant.configure("2") do |config|
config.vm.synced_folder "../", "/vagrant", id: 'vagrant-root'
config.cache.scope = :machine
config.cache.auto_detect = true
2014-02-21 22:51:44 +00:00
config.cache.synced_folder_opts = { type: :nfs }
2014-02-21 22:51:44 +00:00
config.vm.provider :virtualbox do |vb|
vb.customize [ "modifyvm", :id, "--memory", 256, "--cpus", "1" ]
end
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
2014-02-21 22:51:44 +00:00
initial_debian_setup = lambda do |debian, git_pkg = 'git'|
debian.vm.provision :shell, inline: "apt-get update && apt-get install -y #{git_pkg} php5-cli curl wget htop"
end
install_nvm_and_rvm = lambda do |node|
# Installs RVM
node.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
node.vm.provision :shell, inline: '
if ! [ -d /home/vagrant/.rvm/rubies/ruby-2.0.0* ]; then
HOME=/home/vagrant su -p vagrant -l -c "rvm install 2.0.0 && rvm use 2.0.0 --default"
fi
'
node.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
'
node.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-08-15 03:41:59 +00:00
'
end
config.vm.define :ubuntu do |ubuntu|
ubuntu.vm.box = "quantal64"
2013-11-06 21:42:24 +00:00
configure_private_network.call ubuntu, 10
2014-02-21 22:51:44 +00:00
initial_debian_setup.call(ubuntu)
install_nvm_and_rvm.call(ubuntu)
ubuntu.omnibus.chef_version = :latest
ubuntu.vm.provision :chef_solo do |chef|
chef.add_recipe "java::oracle"
chef.json = {
:java => {
:oracle => {
:accept_oracle_download_terms => true
}
}
}
end
end
2013-09-11 23:47:24 +00:00
config.vm.define :lucid do |lucid|
lucid.vm.box = "lucid64"
2014-02-21 22:51:44 +00:00
# Disable NFS
lucid.cache.synced_folder_opts = { }
2013-11-06 21:42:24 +00:00
configure_private_network.call lucid, 11
2014-02-21 22:51:44 +00:00
initial_debian_setup.call(lucid, 'git-core')
install_nvm_and_rvm.call(lucid)
2013-09-11 23:47:24 +00:00
end
config.vm.define :debian do |debian|
debian.vm.box = "squeeze64"
debian.vm.box_url = 'http://f.willianfernandes.com.br/vagrant-boxes/DebianSqueeze64.box'
2013-11-06 21:42:24 +00:00
configure_private_network.call debian, 12
2014-02-21 22:51:44 +00:00
initial_debian_setup.call(debian)
install_nvm_and_rvm.call(debian)
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
2014-02-21 22:51:44 +00:00
centos.vm.provision :shell, inline: '
2014-02-21 22:51:44 +00:00
(
mkdir -p /tmp/epel
cd /tmp/epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
)
yum install -y libffi-devel ruby-devel git
'
centos.vm.provision :shell, inline: 'gem install bundler'
end
config.vm.define :arch do |arch|
arch.vm.box = 'arch64'
2014-02-26 02:53:49 +00:00
arch.vm.box_url = 'https://dl.dropboxusercontent.com/u/6750592/Arch_Linux_2013.11_x64.box'
2014-02-21 22:51:44 +00:00
# Disable NFS
arch.cache.synced_folder_opts = { }
2014-02-26 02:54:05 +00:00
arch.vm.provision :shell, inline: 'pacman -Syu --noconfirm libffi git ruby && gem install bundler'
end
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'
2014-02-21 22:51:44 +00:00
# Disable NFS
suse.cache.synced_folder_opts = { }
2014-02-26 02:54:05 +00:00
suse.vm.provision :shell, inline: 'time zypper install -y git'
end
end