1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3 $script = <<SCRIPT
4 echo Installing dependencies...
5 sudo apt-get update
6 sudo apt-get install -y unzip curl
7 echo Fetching Consul...
8 cd /tmp/
9 wget https://releases.hashicorp.com/consul/0.6.1/consul_0.6.1_linux_amd64.zip -O consul.zip
10 echo Installing Consul...
11 unzip consul.zip
12 sudo chmod +x consul
13 sudo mv consul /usr/bin/consul
14 sudo mkdir /etc/consul.d
15 sudo chmod a+w /etc/consul.d
16 SCRIPT
17
18 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
19 VAGRANTFILE_API_VERSION = "2"
20
21 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
22 config.vm.box = "debian/wheezy64"
23
24 config.vm.provision "shell", inline: $script
25
26 config.vm.define "n1" do |n1|
27 n1.vm.hostname = "n1"
28 n1.vm.network "private_network", ip: "172.20.20.10"
29 end
30
31 config.vm.define "n2" do |n2|
32 n2.vm.hostname = "n2"
33 n2.vm.network "private_network", ip: "172.20.20.11"
34 end
35 end