aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-07-16 06:24:18 +0000
committerGerrit Code Review <review@openstack.org>2015-07-16 06:24:18 +0000
commit9f3d98dceccca0bd49f727a62a777782d62d703b (patch)
tree5e93f7dcc284b2e89206caf6abab7dcf16ff9f17
parent9c5e708fe247234459d153b77893b172e45760de (diff)
parent02bd1332066eb0531046803f6b35282ebc9be02b (diff)
downloadkolla-9f3d98dceccca0bd49f727a62a777782d62d703b.tar.gz
kolla-9f3d98dceccca0bd49f727a62a777782d62d703b.zip
Merge "Move keepalived common files to common dir"
l---------[-rwxr-xr-x]docker/centos/binary/keepalived/check_alive.sh8
l---------[-rwxr-xr-x]docker/centos/binary/keepalived/keepalived.conf20
l---------[-rwxr-xr-x]docker/centos/binary/keepalived/start.sh30
-rwxr-xr-xdocker/common/keepalived/check_alive.sh7
-rwxr-xr-xdocker/common/keepalived/keepalived.conf19
-rwxr-xr-xdocker/common/keepalived/start.sh29
6 files changed, 58 insertions, 55 deletions
diff --git a/docker/centos/binary/keepalived/check_alive.sh b/docker/centos/binary/keepalived/check_alive.sh
index ee0c5a85b..e9bfd9d1f 100755..120000
--- a/docker/centos/binary/keepalived/check_alive.sh
+++ b/docker/centos/binary/keepalived/check_alive.sh
@@ -1,7 +1 @@
-#!/bin/bash
-
-# This is noop check script. Change it to something meaningful.
-# TODO (inc0): When HAProxy is implemented, this should be changed to HAProxy check
-# https://github.com/stackforge/kolla/blob/master/specs/high-availability.rst
-
-exit 0
+../../../common/keepalived/check_alive.sh \ No newline at end of file
diff --git a/docker/centos/binary/keepalived/keepalived.conf b/docker/centos/binary/keepalived/keepalived.conf
index 2a58fc018..d9794c9e5 100755..120000
--- a/docker/centos/binary/keepalived/keepalived.conf
+++ b/docker/centos/binary/keepalived/keepalived.conf
@@ -1,19 +1 @@
-vrrp_script check_alive {
- script "/check_alive.sh"
- interval 2
- weight -10
-}
-
-vrrp_instance Floating {
- state MASTER
- interface @PUBLIC_INTERFACE@
- virtual_router_id 51
- priority @KEEPALIVED_PRIORITY@
- advert_int 1
- virtual_ipaddress {
- @PUBLIC_IP@
- }
- track_script {
- check_alive
- }
-}
+../../../common/keepalived/keepalived.conf \ No newline at end of file
diff --git a/docker/centos/binary/keepalived/start.sh b/docker/centos/binary/keepalived/start.sh
index 7f582b218..05b222220 100755..120000
--- a/docker/centos/binary/keepalived/start.sh
+++ b/docker/centos/binary/keepalived/start.sh
@@ -1,29 +1 @@
-#!/bin/bash
-
-. /opt/kolla/kolla-common.sh
-
-check_required_vars KEEPALIVED_HOST_PRIORITIES PUBLIC_IP PUBLIC_INTERFACE
-
-MY_HOSTNAME=`hostname`
-
-# here we unpack KEEPALIVED_HOST_PRIORITIES hostname:priority pairs and match
-# them with current hostname, if it's there
-for i in ${KEEPALIVED_HOST_PRIORITIES//,/ }; do
- HOST_PRIORITY=(${i//:/ })
- if [ "$MY_HOSTNAME" == "${HOST_PRIORITY[0]}" ]; then
- KEEPALIVED_PRIORITY=${HOST_PRIORITY[1]}
- fi
-done
-
-if [ -z "$KEEPALIVED_PRIORITY" ]; then
- echo "ERROR: missing hostname in KEEPALIVED_HOST_PRIORITIES: $MY_HOSTNAME" >&2
- exit 1
-fi
-
-sed -i '
- s|@PUBLIC_INTERFACE@|'$PUBLIC_INTERFACE'|g
- s|@PUBLIC_IP@|'$PUBLIC_IP'|g
- s|@KEEPALIVED_PRIORITY@|'$KEEPALIVED_PRIORITY'|g
-' /etc/keepalived/keepalived.conf
-
-exec /usr/sbin/keepalived -nld -p /run/keepalived.pid
+../../../common/keepalived/start.sh \ No newline at end of file
diff --git a/docker/common/keepalived/check_alive.sh b/docker/common/keepalived/check_alive.sh
new file mode 100755
index 000000000..ee0c5a85b
--- /dev/null
+++ b/docker/common/keepalived/check_alive.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# This is noop check script. Change it to something meaningful.
+# TODO (inc0): When HAProxy is implemented, this should be changed to HAProxy check
+# https://github.com/stackforge/kolla/blob/master/specs/high-availability.rst
+
+exit 0
diff --git a/docker/common/keepalived/keepalived.conf b/docker/common/keepalived/keepalived.conf
new file mode 100755
index 000000000..2a58fc018
--- /dev/null
+++ b/docker/common/keepalived/keepalived.conf
@@ -0,0 +1,19 @@
+vrrp_script check_alive {
+ script "/check_alive.sh"
+ interval 2
+ weight -10
+}
+
+vrrp_instance Floating {
+ state MASTER
+ interface @PUBLIC_INTERFACE@
+ virtual_router_id 51
+ priority @KEEPALIVED_PRIORITY@
+ advert_int 1
+ virtual_ipaddress {
+ @PUBLIC_IP@
+ }
+ track_script {
+ check_alive
+ }
+}
diff --git a/docker/common/keepalived/start.sh b/docker/common/keepalived/start.sh
new file mode 100755
index 000000000..7f582b218
--- /dev/null
+++ b/docker/common/keepalived/start.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+. /opt/kolla/kolla-common.sh
+
+check_required_vars KEEPALIVED_HOST_PRIORITIES PUBLIC_IP PUBLIC_INTERFACE
+
+MY_HOSTNAME=`hostname`
+
+# here we unpack KEEPALIVED_HOST_PRIORITIES hostname:priority pairs and match
+# them with current hostname, if it's there
+for i in ${KEEPALIVED_HOST_PRIORITIES//,/ }; do
+ HOST_PRIORITY=(${i//:/ })
+ if [ "$MY_HOSTNAME" == "${HOST_PRIORITY[0]}" ]; then
+ KEEPALIVED_PRIORITY=${HOST_PRIORITY[1]}
+ fi
+done
+
+if [ -z "$KEEPALIVED_PRIORITY" ]; then
+ echo "ERROR: missing hostname in KEEPALIVED_HOST_PRIORITIES: $MY_HOSTNAME" >&2
+ exit 1
+fi
+
+sed -i '
+ s|@PUBLIC_INTERFACE@|'$PUBLIC_INTERFACE'|g
+ s|@PUBLIC_IP@|'$PUBLIC_IP'|g
+ s|@KEEPALIVED_PRIORITY@|'$KEEPALIVED_PRIORITY'|g
+' /etc/keepalived/keepalived.conf
+
+exec /usr/sbin/keepalived -nld -p /run/keepalived.pid