From b481ca719281e0d1b72c03bc4458188d4f33ec19 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Mon, 21 Jan 2019 20:09:01 -0500 Subject: [PATCH] Updated consul to use /opt/consul and default to 1.4.0 --- consul/defaults.yaml | 2 +- consul/files/consul.service | 2 +- consul/files/consul.sysvinit | 2 +- consul/files/consul.upstart | 2 +- consul/install.sls | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/consul/defaults.yaml b/consul/defaults.yaml index 0ea69a7..80c1306 100644 --- a/consul/defaults.yaml +++ b/consul/defaults.yaml @@ -1,5 +1,5 @@ consul: - version: 0.7.0 + version: 1.4.0 download_host: releases.hashicorp.com service: false diff --git a/consul/files/consul.service b/consul/files/consul.service index 0dd110c..83686f8 100644 --- a/consul/files/consul.service +++ b/consul/files/consul.service @@ -5,7 +5,7 @@ After=network.target [Service] EnvironmentFile=-/etc/{% if grains['os_family'] == 'Debian' %}default{% else %}sysconfig{% endif %}/consul -ExecStart=/usr/local/bin/consul agent -config-dir=/etc/consul.d +ExecStart=/opt/consul/bin/consul agent -config-dir=/etc/consul.d ExecReload=/bin/kill -HUP $MAINPID KillSignal=TERM User={{ user }} diff --git a/consul/files/consul.sysvinit b/consul/files/consul.sysvinit index 25035fa..1853dd8 100644 --- a/consul/files/consul.sysvinit +++ b/consul/files/consul.sysvinit @@ -24,7 +24,7 @@ . /etc/rc.d/init.d/functions prog="consul" -exec="/usr/local/bin/$prog" +exec="/opt/consul/bin/$prog" pidfile="/var/run/$prog.pid" lockfile="/var/lock/subsys/$prog" logfile="/var/log/$prog" diff --git a/consul/files/consul.upstart b/consul/files/consul.upstart index f54d6cf..db00a8d 100644 --- a/consul/files/consul.upstart +++ b/consul/files/consul.upstart @@ -18,7 +18,7 @@ script exec start-stop-daemon --start \ --chuid ${CONSUL_USER:-consul}:${CONSUL_GROUP:-consul} \ - --exec /usr/local/bin/consul agent -- \ + --exec /opt/consul/bin/consul agent -- \ -config-dir="/etc/consul.d" \ ${CONSUL_FLAGS} \ >> /var/log/consul.log 2>&1 diff --git a/consul/install.sls b/consul/install.sls index 047c447..ca0c867 100644 --- a/consul/install.sls +++ b/consul/install.sls @@ -6,7 +6,7 @@ consul-dep-unzip: consul-bin-dir: file.directory: - - name: /usr/local/bin + - name: /opt/consul/bin - makedirs: True # Create consul user @@ -47,7 +47,7 @@ consul-download: - name: /tmp/consul_{{ consul.version }}_linux_{{ consul.arch }}.zip - source: https://{{ consul.download_host }}/consul/{{ consul.version }}/consul_{{ consul.version }}_linux_{{ consul.arch }}.zip - source_hash: https://releases.hashicorp.com/consul/{{ consul.version }}/consul_{{ consul.version }}_SHA256SUMS - - unless: test -f /usr/local/bin/consul-{{ consul.version }} + - unless: test -f /opt/consul/bin/consul-{{ consul.version }} consul-extract: cmd.wait: @@ -57,10 +57,10 @@ consul-extract: consul-install: file.rename: - - name: /usr/local/bin/consul-{{ consul.version }} + - name: /opt/consul/bin/consul-{{ consul.version }} - source: /tmp/consul - require: - - file: /usr/local/bin + - file: /opt/consul/bin - watch: - cmd: consul-extract @@ -73,6 +73,6 @@ consul-clean: consul-link: file.symlink: - target: consul-{{ consul.version }} - - name: /usr/local/bin/consul + - name: /opt/consul/bin/consul - watch: - file: consul-install