-
-
Save themartorana/460a52bb3f840010ecde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Don't use, weird issue | |
# UBUNTU_12_10 = { | |
# sudo_group: "sudo", | |
# box: "flyclops-vagrant-ubuntu-12.10-cloud", | |
# url: "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" | |
# } | |
UBUNTU_13_04 = { | |
sudo_group: "sudo", | |
box: "vagrant-ubuntu-13.04-cloud", | |
url: "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box" | |
} | |
NODES = 1 | |
OS = UBUNTU_13_04 | |
BASE_IP = "172.16.0" | |
IP_INCREMENT = 10 | |
Vagrant.configure("2") do |cluster| | |
(1..NODES).each do |index| | |
last_octet = index * IP_INCREMENT | |
cluster.vm.define "riak#{index}".to_sym do |config| | |
# Configure the VM and operating system. | |
config.vm.box = OS[:box] | |
config.vm.box_url = OS[:url] | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", 4096] | |
# vb.gui = true | |
end | |
config.vm.hostname = "riak#{index}" | |
config.vm.network :private_network, ip: "#{BASE_IP}.#{last_octet}" | |
# Setup the network and additional file shares. | |
if index == 1 | |
#config.vm.network :forwarded_port, guest: 8096, host: 8096 | |
config.vm.network :forwarded_port, guest: 10016, host: 10016 | |
config.vm.network :forwarded_port, guest: 10017, host: 10017 | |
config.vm.network :forwarded_port, guest: 10018, host: 10018 | |
end | |
config.vm.synced_folder "source/", "/home/vagrant/source" | |
# Run provisioning script | |
config.vm.provision :shell, :path => "vagrant_build.sh" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment