blob: c9494e312389961f4b78b25f3eaab8ac1479e5d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
[Unit]
Description=Launch Consul Cluster
[Service]
Restart=on-failure
RestartSec=45
ExecStartPre=/bin/sh -c 'echo -ne \'{"data_dir":\"/var/consul","server":true,"bootstrap_expect":1,\' > /tmp/consul.conf'
ExecStartPre=/bin/sh -c 'echo -ne \'"bind_addr":"\'$(ifconfig br0 | awk \'/inet addr/{print substr($2,6)}\')\'"}\' >> /tmp/consul.conf'
ExecStart=/usr/bin/consul agent -config-file=/tmp/consul.conf
[Install]
WantedBy=multi-user.target
|