2014-04-11 00:34:10 +00:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
$script = <<SCRIPT
|
|
|
|
|
2014-04-19 11:34:28 +00:00
|
|
|
echo Installing dependencies...
|
2015-11-28 15:52:40 +00:00
|
|
|
sudo apt-get update
|
2014-10-18 04:39:44 +00:00
|
|
|
sudo apt-get install -y unzip curl
|
2014-04-11 00:34:10 +00:00
|
|
|
|
|
|
|
echo Fetching Consul...
|
|
|
|
cd /tmp/
|
2016-11-21 17:49:59 +00:00
|
|
|
curl -s https://releases.hashicorp.com/consul/0.7.1/consul_0.7.1_linux_amd64.zip -o consul.zip
|
2014-04-11 00:34:10 +00:00
|
|
|
|
|
|
|
echo Installing Consul...
|
|
|
|
unzip consul.zip
|
|
|
|
sudo chmod +x consul
|
|
|
|
sudo mv consul /usr/bin/consul
|
|
|
|
|
2015-07-22 11:33:15 +00:00
|
|
|
sudo mkdir /etc/consul.d
|
|
|
|
sudo chmod a+w /etc/consul.d
|
|
|
|
|
2014-04-11 00:34:10 +00:00
|
|
|
SCRIPT
|
|
|
|
|
2016-11-21 17:49:59 +00:00
|
|
|
# Specify a custom Vagrant box for the demo
|
|
|
|
DEMO_BOX_NAME = ENV['DEMO_BOX_NAME'] || "debian/jessie64"
|
|
|
|
|
|
|
|
# Vagrantfile API/syntax version.
|
|
|
|
# NB: Don't touch unless you know what you're doing!
|
2014-04-11 00:34:10 +00:00
|
|
|
VAGRANTFILE_API_VERSION = "2"
|
|
|
|
|
|
|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
2016-11-21 17:49:59 +00:00
|
|
|
config.vm.box = DEMO_BOX_NAME
|
2014-04-11 00:34:10 +00:00
|
|
|
|
|
|
|
config.vm.provision "shell", inline: $script
|
|
|
|
|
|
|
|
config.vm.define "n1" do |n1|
|
2014-04-20 12:04:43 +00:00
|
|
|
n1.vm.hostname = "n1"
|
2014-04-11 00:34:10 +00:00
|
|
|
n1.vm.network "private_network", ip: "172.20.20.10"
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.define "n2" do |n2|
|
2014-04-20 12:04:43 +00:00
|
|
|
n2.vm.hostname = "n2"
|
2014-04-11 00:34:10 +00:00
|
|
|
n2.vm.network "private_network", ip: "172.20.20.11"
|
|
|
|
end
|
|
|
|
end
|