Merge "Make keepalived configuration future-proof"

This commit is contained in:
Zuul 2019-02-14 05:13:14 +00:00 committed by Gerrit Code Review
commit ac55d4a6a4
3 changed files with 36 additions and 2 deletions

View File

@ -35,9 +35,11 @@ keepalived_global_defs:
keepalived_scripts:
haproxy_check_script:
check_script: "/bin/kill -0 `cat /var/run/haproxy.pid`"
check_script: "/etc/keepalived/haproxy_check.sh"
src_check_script: "{{ playbook_dir }}/../scripts/keepalived_haproxy_check.sh"
pingable_check_script:
check_script: "/bin/ping -c {{ keepalived_ping_count }} {{ keepalived_ping_address }} 1>&2"
check_script: "/etc/keepalived/pingable_check.sh {{ keepalived_ping_count }} {{ keepalived_ping_address }}"
src_ping_script: "{{ playbook_dir }}/../scripts/keepalived_pingable_check.sh"
interval: "{{ keepalived_ping_interval }}"
fall: 2
rise: 4

View File

@ -0,0 +1,16 @@
#!/bin/sh
# Copyright 2019, Luis Domingues <domigues.luis@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
/bin/kill -0 $(cat /var/run/haproxy.pid)

View File

@ -0,0 +1,16 @@
#!/bin/sh
# Copyright 2019, Luis Domingues <domigues.luis@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
/bin/ping -c $1 $2 1>&2