neutron: don't set external_network_bridge option by default
[apex-tripleo-heat-templates.git] / extraconfig / tasks / major_upgrade_object_storage.sh
1 #!/bin/bash
2 #
3 # This delivers the swift-storage upgrade script to be invoked as part of the tripleo
4 # major upgrade workflow.
5 #
6 set -eu
7
8 UPGRADE_SCRIPT=/root/tripleo_upgrade_node.sh
9
10 cat > $UPGRADE_SCRIPT << ENDOFCAT
11 ### DO NOT MODIFY THIS FILE
12 ### This file is automatically delivered to the swift-storage nodes as part of the
13 ### tripleo upgrades workflow
14
15 set -eu
16
17 function systemctl_swift {
18     action=\$1
19     for S in openstack-swift-account-auditor openstack-swift-account-reaper openstack-swift-account-replicator openstack-swift-account \
20              openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container \
21              openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object; do
22                 systemctl \$action \$S
23     done
24 }
25
26 # Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
27 if [[ -n \$(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
28     echo "Manual upgrade of openvswitch - restart in postun detected"
29     mkdir OVS_UPGRADE || true
30     pushd OVS_UPGRADE
31     echo "Attempting to downloading latest openvswitch with yumdownloader"
32     yumdownloader --resolve openvswitch
33     echo "Updating openvswitch with nopostun option"
34     rpm -U --replacepkgs --nopostun ./*.rpm
35     popd
36 else
37     echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
38 fi
39
40 systemctl_swift stop
41
42 yum -y install python-zaqarclient  # needed for os-collect-config
43 yum -y update
44
45 systemctl_swift start
46
47
48
49 ENDOFCAT
50
51 # ensure the permissions are OK
52 chmod 0755 $UPGRADE_SCRIPT
53