merge Add Router ID with environment KEEPALIVED_ROUTER_ID #16

This commit is contained in:
Bertrand Gouny 2018-05-14 21:28:06 +02:00
commit 743eee1f61
3 changed files with 4 additions and 1 deletions

View File

@ -16,3 +16,5 @@ KEEPALIVED_VIRTUAL_IPS:
- 192.168.1.232
KEEPALIVED_NOTIFY: /container/service/keepalived/assets/notify.sh
KEEPALIVED_ROUTER_ID: 51

View File

@ -10,7 +10,7 @@ vrrp_instance VI_1 {
}
state BACKUP
virtual_router_id 51
virtual_router_id {{ KEEPALIVED_ROUTER_ID }}
priority {{ KEEPALIVED_PRIORITY }}
nopreempt

View File

@ -11,6 +11,7 @@ if [ ! -e "$FIRST_START_DONE" ]; then
#
# bootstrap config
#
sed -i "s|{{ KEEPALIVED_ROUTER_ID }}|$KEEPALIVED_ROUTER_ID|g" ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf
sed -i "s|{{ KEEPALIVED_INTERFACE }}|$KEEPALIVED_INTERFACE|g" ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf
sed -i "s|{{ KEEPALIVED_PRIORITY }}|$KEEPALIVED_PRIORITY|g" ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf
sed -i "s|{{ KEEPALIVED_PASSWORD }}|$KEEPALIVED_PASSWORD|g" ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf