|
|
|
@ -18,7 +18,7 @@ fi
|
|
|
|
|
mkdir -p /etc/consul.d/ && chown -R consul:consul /etc/consul.d/
|
|
|
|
|
|
|
|
|
|
# write systemd conf
|
|
|
|
|
cat >>/etc/systemd/system/consul.service <<EOF
|
|
|
|
|
cat >/etc/systemd/system/consul.service <<EOF
|
|
|
|
|
[Unit]
|
|
|
|
|
Description="HashiCorp Consul - A service mesh solution"
|
|
|
|
|
Documentation=https://www.consul.io/
|
|
|
|
@ -71,7 +71,7 @@ done
|
|
|
|
|
if [ $consultype == "client" ]
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
cat >> /etc/consul.d/consul.hcl <<EOF
|
|
|
|
|
cat >/etc/consul.d/consul.hcl <<EOF
|
|
|
|
|
datacenter = "dc1"
|
|
|
|
|
data_dir = "/opt/consul"
|
|
|
|
|
client_addr = $bind_ip
|
|
|
|
@ -81,7 +81,7 @@ EOF
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
cat >> /etc/consul.d/server.hcl <<EOF
|
|
|
|
|
cat >/etc/consul.d/server.hcl <<EOF
|
|
|
|
|
datacenter = "dc1"
|
|
|
|
|
data_dir = "/opt/consul"
|
|
|
|
|
bind_addr = $bind_ip
|
|
|
|
|