Code Review
/
apex-tripleo-heat-templates.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Add validation for VPP upgrade tasks"
[apex-tripleo-heat-templates.git]
/
extraconfig
/
tasks
/
pacemaker_resource_restart.sh
diff --git
a/extraconfig/tasks/pacemaker_resource_restart.sh
b/extraconfig/tasks/pacemaker_resource_restart.sh
index
3da7efe
..
49d39bc
100755
(executable)
--- a/
extraconfig/tasks/pacemaker_resource_restart.sh
+++ b/
extraconfig/tasks/pacemaker_resource_restart.sh
@@
-4,11
+4,14
@@
set -eux
# Run if pacemaker is running, we're the bootstrap node,
# and we're updating the deployment (not creating).
# Run if pacemaker is running, we're the bootstrap node,
# and we're updating the deployment (not creating).
-if [[ -n $(pcmk_running) && -n $(is_bootstrap_node) ]]; then
+
+RESTART_FOLDER="/var/lib/tripleo/pacemaker-restarts"
+
+if [[ -d "$RESTART_FOLDER" && -n $(pcmk_running) && -n $(is_bootstrap_node) ]]; then
TIMEOUT=600
TIMEOUT=600
- SERVICES_TO_RESTART="$(ls /var/lib/tripleo/pacemaker-restarts)"
PCS_STATUS_OUTPUT="$(pcs status)"
PCS_STATUS_OUTPUT="$(pcs status)"
+ SERVICES_TO_RESTART="$(ls $RESTART_FOLDER)"
for service in $SERVICES_TO_RESTART; do
if ! echo "$PCS_STATUS_OUTPUT" | grep $service; then
for service in $SERVICES_TO_RESTART; do
if ! echo "$PCS_STATUS_OUTPUT" | grep $service; then
@@
-20,6
+23,11
@@
if [[ -n $(pcmk_running) && -n $(is_bootstrap_node) ]]; then
for service in $SERVICES_TO_RESTART; do
echo "Restarting $service..."
pcs resource restart --wait=$TIMEOUT $service
for service in $SERVICES_TO_RESTART; do
echo "Restarting $service..."
pcs resource restart --wait=$TIMEOUT $service
- rm -f
/var/lib/tripleo/pacemaker-restarts
/$service
+ rm -f
"$RESTART_FOLDER"
/$service
done
done
+
+fi
+
+if [ $(systemctl is-active haproxy) = "active" ]; then
+ systemctl reload haproxy
fi
fi