From 8a9926c6ae0dba8b9037b589fd573d7095ab545b Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Mon, 3 Jul 2017 16:43:47 -0700 Subject: [PATCH] Start consul in getting started vagrant Sneak a version bump to consul in as well --- demo/vagrant/Vagrantfile | 3 +++ demo/vagrant/consul.service | 12 ++++++++++++ scripts/install_consul.sh | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 demo/vagrant/consul.service diff --git a/demo/vagrant/Vagrantfile b/demo/vagrant/Vagrantfile index d13bf4bd6..fab85be7b 100644 --- a/demo/vagrant/Vagrantfile +++ b/demo/vagrant/Vagrantfile @@ -42,6 +42,9 @@ sudo usermod -aG docker vagrant echo "Installing Consul..." cd /opt/nomad bash scripts/install_consul.sh +sudo install -o root /opt/nomad/demo/vagrant/consul.service /etc/systemd/system/consul.service +sudo systemctl enable consul.service +sudo systemctl start consul SCRIPT diff --git a/demo/vagrant/consul.service b/demo/vagrant/consul.service new file mode 100644 index 000000000..0595346ed --- /dev/null +++ b/demo/vagrant/consul.service @@ -0,0 +1,12 @@ +[Unit] +Description=consul agent +Requires=network-online.target +After=network-online.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/consul agent -dev +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/scripts/install_consul.sh b/scripts/install_consul.sh index 9589c965c..e2723d7b8 100755 --- a/scripts/install_consul.sh +++ b/scripts/install_consul.sh @@ -2,7 +2,7 @@ set -e -CONSUL_VERSION="0.8.4" +CONSUL_VERSION="0.8.5" CURDIR=`pwd` if [[ $(which consul >/dev/null && consul version | head -n 1 | cut -d ' ' -f 2) == "v$CONSUL_VERSION" ]]; then