open-consul/terraform/aws/scripts/centos6/upstart-join.conf
Sathiya Shunmugasundaram 0382efbbe1 centos6 Initial commit
2015-06-02 20:57:35 -04:00

26 lines
502 B
Plaintext

description "Join the consul cluster"
start on started consul
stop on stopped consul
task
script
if [ -f "/etc/service/consul-join" ]; then
. /etc/service/consul-join
fi
# Keep trying to join until it succeeds
set +e
while :; do
logger -t "consul-join" "Attempting join: ${CONSUL_JOIN}"
/usr/local/bin/consul join \
${CONSUL_JOIN} \
>>/var/log/consul-join.log 2>&1
[ $? -eq 0 ] && break
sleep 5
done
logger -t "consul-join" "Join success!"
end script