Drop bootstrap_host_exec from pacemaker_restart_bundle

bootstrap_host_exec does not exist on the host so we cannot assume its
existence. Since, barring argument checking, it is three lines of shell
script [1] we just use it directly. We also add an extra echo to make it
simpler to debug any bootstrap vs non-bootstrap issued.

[1] https://github.com/openstack/tripleo-common/blob/master/scripts/bootstrap_host_exec

Change-Id: Ia850286682f09cd75651591a1158c2e467343c1d
Related-Bug: #1863442
(cherry picked from commit 4d8eb35114)
This commit is contained in:
Michele Baldessari 2020-02-21 17:05:46 +01:00
parent 8f2a74eee6
commit da6b7b424c
1 changed files with 9 additions and 2 deletions

View File

@ -36,8 +36,15 @@ if [ x"${TRIPLEO_MINOR_UPDATE,,}" != x"true" ]; then
# have been updated on all nodes. So we need to run pcs only
# once (e.g. on the service's boostrap node).
if bundle_can_be_restarted ${BUNDLE_NAME}; then
echo "$(date -u): Restarting ${BUNDLE_NAME} globally"
/usr/bin/bootstrap_host_exec $TRIPLEO_SERVICE /sbin/pcs resource restart --wait=__PCMKTIMEOUT__ $BUNDLE_NAME
HOSTNAME=$(/bin/hostname -s)
SERVICE_NODEID=$(/bin/hiera -c /etc/puppet/hiera.yaml "${TRIPLEO_SERVICE}_short_bootstrap_node_name")
if [[ "${HOSTNAME,,}" == "${SERVICE_NODEID,,}" ]]; then
echo "$(date -u): Restarting ${BUNDLE_NAME} globally"
/sbin/pcs resource restart --wait=__PCMKTIMEOUT__ $BUNDLE_NAME
else
echo "$(date -u): Skipping global restart of ${BUNDLE_NAME} on ${HOSTNAME} it will be restarted by node ${SERVICE_NODEID}"
fi
else
echo "$(date -u): No global restart needed for ${BUNDLE_NAME}."
fi