From af2319c1dfa34e15b270f5547b7a96899b12af0e Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sat, 26 Oct 2019 11:49:12 +0200 Subject: [PATCH] Fix the exit code of the keepalive notifiy script. --- library/roles/keepalived/templates/keepalived_notify.sh.j2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/roles/keepalived/templates/keepalived_notify.sh.j2 b/library/roles/keepalived/templates/keepalived_notify.sh.j2 index 6370a3e1..a3e4b75c 100644 --- a/library/roles/keepalived/templates/keepalived_notify.sh.j2 +++ b/library/roles/keepalived/templates/keepalived_notify.sh.j2 @@ -6,6 +6,7 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin:$PATH" TYPE=$1 NAME=$2 STATE=$3 +RETVAL=0 {% if keepalived_notify_extra_params is defined %} {{ keepalived_notify_extra_params }} @@ -13,8 +14,8 @@ STATE=$3 {% if keepalived_nagios_check %} -echo $TYPE $NAME is in $STATE state > /var/run/keepalive.state +echo "$TYPE $NAME is in $STATE state" > /var/run/keepalive.state {% endif %} -exit 0 +exit $RETVAL