2014-04-10 17:34:10 -07:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
$script = <<SCRIPT
|
|
|
|
|
2014-04-19 13:34:28 +02:00
|
|
|
echo Installing dependencies...
|
2015-11-28 22:52:40 +07:00
|
|
|
sudo apt-get update
|
2014-10-17 21:39:44 -07:00
|
|
|
sudo apt-get install -y unzip curl
|
2014-04-10 17:34:10 -07:00
|
|
|
|
|
|
|
echo Fetching Consul...
|
|
|
|
cd /tmp/
|
2016-01-13 17:56:19 -05:00
|
|
|
wget https://releases.hashicorp.com/consul/0.6.1/consul_0.6.1_linux_amd64.zip -O consul.zip
|
2014-04-10 17:34:10 -07:00
|
|
|
|
|
|
|
echo Installing Consul...
|
|
|
|
unzip consul.zip
|
|
|
|
sudo chmod +x consul
|
|
|
|
sudo mv consul /usr/bin/consul
|
|
|
|
|
2015-07-22 13:33:15 +02:00
|
|
|
sudo mkdir /etc/consul.d
|
|
|
|
sudo chmod a+w /etc/consul.d
|
|
|
|
|
2014-04-10 17:34:10 -07:00
|
|
|
SCRIPT
|
|
|
|
|
|
|
|
# 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|
|
2015-07-14 11:43:18 -07:00
|
|
|
config.vm.box = "debian/wheezy64"
|
2014-04-10 17:34:10 -07:00
|
|
|
|
|
|
|
config.vm.provision "shell", inline: $script
|
|
|
|
|
|
|
|
config.vm.define "n1" do |n1|
|
2014-04-20 14:04:43 +02:00
|
|
|
n1.vm.hostname = "n1"
|
2014-04-10 17:34:10 -07:00
|
|
|
n1.vm.network "private_network", ip: "172.20.20.10"
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.define "n2" do |n2|
|
2014-04-20 14:04:43 +02:00
|
|
|
n2.vm.hostname = "n2"
|
2014-04-10 17:34:10 -07:00
|
|
|
n2.vm.network "private_network", ip: "172.20.20.11"
|
|
|
|
end
|
|
|
|
end
|