summaryrefslogtreecommitdiffstats
path: root/extraconfig
diff options
context:
space:
mode:
authorSteve Baker <sbaker@redhat.com>2015-10-01 10:17:29 +1300
committerSteve Baker <sbaker@redhat.com>2015-10-01 15:40:55 +1300
commit77e8ec22a9cfa05c11a8654ce3a02c1bb3b4578f (patch)
treea0bb75435abc7d6202eb028b770673a87792b52b /extraconfig
parent3fd199d8e7fa59979a0aff7d78cce61d6cd607a8 (diff)
Force stop a single node pacemaker on yum update
Currently package updates won't occur on a single node non-HA pacemaker managed Controller because stopping the node loses the quorum of 1. This change gets the count of current nodes in the cluster and if the count is 1 then specify --force when doing a pcs cluster stop. Change-Id: I0de2488e24f1ef53a935dbc90ec6de6142bb4264
Diffstat (limited to 'extraconfig')
-rwxr-xr-xextraconfig/tasks/yum_update.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/extraconfig/tasks/yum_update.sh b/extraconfig/tasks/yum_update.sh
index eaeb7ef0..9125ca07 100755
--- a/extraconfig/tasks/yum_update.sh
+++ b/extraconfig/tasks/yum_update.sh
@@ -44,7 +44,13 @@ pacemaker_status=$(systemctl is-active pacemaker)
if [[ "$pacemaker_status" == "active" ]] ; then
echo "Pacemaker running, stopping cluster node and doing full package update"
- pcs cluster stop
+ node_count=$(pcs status xml | grep -o "<nodes_configured.*/>" | grep -o 'number="[0-9]*"' | grep -o "[0-9]*")
+ if [[ "$node_count" == "1" ]] ; then
+ echo "Active node count is 1, stopping node with --force"
+ pcs cluster stop --force
+ else
+ pcs cluster stop
+ fi
else
echo "Excluding upgrading packages that are handled by config management tooling"
command_arguments="$command_arguments --skip-broken"