kolla-ansible/docker/haproxy/ensure_latest_config.sh
Sam Yaple 89ecfc164e Replace config-external - haproxy keepalived
Change-Id: I668c31401305713e720f0f0ae8ec18e320ea1c76
Partially-Implements: blueprint replace-config-external
2015-09-25 11:06:27 +00:00

13 lines
398 B
Bash
Executable File

#!/bin/bash
CURRENT_CONFIG_HASH=$(sha1sum /etc/haproxy/haproxy.cfg | cut -f1 -d' ')
NEW_CONFIG_HASH=$(sha1sum /opt/kolla/config_files/haproxy.cfg | cut -f1 -d' ')
if [[ $CURRENT_CONFIG_HASH != $NEW_CONFIG_HASH ]]; then
changed=changed
source /opt/kolla/config-external.sh
/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -sf $(cat /run/haproxy.pid)
fi
echo $changed