Fix race during major-upgrade-pacemaker step
[apex-tripleo-heat-templates.git] / extraconfig / tasks / major_upgrade_block_storage.sh
1 #!/bin/bash
2 #
3 # This runs an upgrade of Cinder Block Storage nodes.
4 #
5 set -eu
6
7 # Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
8 if [[ -n $(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
9     echo "Manual upgrade of openvswitch - restart in postun detected"
10     mkdir OVS_UPGRADE || true
11     pushd OVS_UPGRADE
12     echo "Attempting to downloading latest openvswitch with yumdownloader"
13     yumdownloader --resolve openvswitch
14     echo "Updating openvswitch with nopostun option"
15     rpm -U --replacepkgs --nopostun ./*.rpm
16     popd
17 else
18     echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
19 fi
20
21 yum -y install python-zaqarclient  # needed for os-collect-config
22 yum -y -q update