|
|
@ -1,16 +1,17 @@
|
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
|
|
|
|
$script = <<SCRIPT
|
|
|
|
$script = <<SCRIPT
|
|
|
|
|
|
|
|
|
|
|
|
echo Installing dependencies...
|
|
|
|
echo "Installing dependencies ..."
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y unzip curl
|
|
|
|
sudo apt-get install -y unzip curl
|
|
|
|
|
|
|
|
|
|
|
|
echo Fetching Consul...
|
|
|
|
echo "Fetching Consul version ${CONSUL_DEMO_VERSION} ..."
|
|
|
|
cd /tmp/
|
|
|
|
cd /tmp/
|
|
|
|
curl -s https://releases.hashicorp.com/consul/0.7.1/consul_0.7.1_linux_amd64.zip -o consul.zip
|
|
|
|
curl -s https://releases.hashicorp.com/consul/${CONSUL_DEMO_VERSION}/consul_${CONSUL_DEMO_VERSION}_linux_amd64.zip -o consul.zip
|
|
|
|
|
|
|
|
|
|
|
|
echo Installing Consul...
|
|
|
|
echo "Installing Consul version ${CONSUL_DEMO_VERSION} ..."
|
|
|
|
unzip consul.zip
|
|
|
|
unzip consul.zip
|
|
|
|
sudo chmod +x consul
|
|
|
|
sudo chmod +x consul
|
|
|
|
sudo mv consul /usr/bin/consul
|
|
|
|
sudo mv consul /usr/bin/consul
|
|
|
@ -20,8 +21,11 @@ sudo chmod a+w /etc/consul.d
|
|
|
|
|
|
|
|
|
|
|
|
SCRIPT
|
|
|
|
SCRIPT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Specify a Consul version
|
|
|
|
|
|
|
|
CONSUL_DEMO_VERSION = ENV['CONSUL_DEMO_VERSION'] || "0.7.2"
|
|
|
|
|
|
|
|
|
|
|
|
# Specify a custom Vagrant box for the demo
|
|
|
|
# Specify a custom Vagrant box for the demo
|
|
|
|
DEMO_BOX_NAME = ENV['DEMO_BOX_NAME'] || "debian/jessie64"
|
|
|
|
DEMO_BOX_NAME = ENV['DEMO_BOX_NAME'] || "debian/jessie64"
|
|
|
|
|
|
|
|
|
|
|
|
# Vagrantfile API/syntax version.
|
|
|
|
# Vagrantfile API/syntax version.
|
|
|
|
# NB: Don't touch unless you know what you're doing!
|
|
|
|
# NB: Don't touch unless you know what you're doing!
|
|
|
@ -30,7 +34,9 @@ VAGRANTFILE_API_VERSION = "2"
|
|
|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
|
|
config.vm.box = DEMO_BOX_NAME
|
|
|
|
config.vm.box = DEMO_BOX_NAME
|
|
|
|
|
|
|
|
|
|
|
|
config.vm.provision "shell", inline: $script
|
|
|
|
config.vm.provision "shell",
|
|
|
|
|
|
|
|
inline: $script,
|
|
|
|
|
|
|
|
env: {'CONSUL_DEMO_VERSION' => CONSUL_DEMO_VERSION}
|
|
|
|
|
|
|
|
|
|
|
|
config.vm.define "n1" do |n1|
|
|
|
|
config.vm.define "n1" do |n1|
|
|
|
|
n1.vm.hostname = "n1"
|
|
|
|
n1.vm.hostname = "n1"
|
|
|
|