Skip to content

Instantly share code, notes, and snippets.

@jdrago999
Forked from cbednarski/install-consul.sh
Last active February 15, 2017 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdrago999/23f50894e973aa9745070a8986a68e92 to your computer and use it in GitHub Desktop.
Save jdrago999/23f50894e973aa9745070a8986a68e92 to your computer and use it in GitHub Desktop.
Ubuntu installer script for consul
#!/bin/bash -e
set -x
mkdir -p /tmp/consul
cd /tmp/consul
# Consul Configuration File
tee consul.json <<CONSULCONFIG
{
"client_addr": "0.0.0.0",
"data_dir": "/var/lib/consul",
"datacenter": "default",
"enable_syslog": true,
"log_level": "INFO",
"server": false
}
CONSULCONFIG
# Download things
wget -q -nc https://releases.hashicorp.com/consul/0.7.3/consul_0.7.3_linux_amd64.zip
# Update
sudo apt-get update -qq
sudo apt-get install -y unzip
# Install everything
unzip -o consul_0.7.3_linux_amd64.zip
sudo cp consul /usr/local/bin/consul
sudo mkdir -p /etc/consul
sudo mkdir -p /var/lib/consul
sudo cp consul.json /etc/consul/consul.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment