tripleo-heat-templates/extraconfig/tasks/tripleo_upgrade_node.sh
marios 4c5b9c5c96 Remove puppet run and workarounds from tripleo_upgrade_node.sh
For bug 1708115 and the O..P upgrade, and for the upgrade of
'non-controlers' we are now generating ansible playbooks from
collected service upgrade_tasks and these are executed instead
of the legacy tripleo_upgrade_node.sh.

To clarify, by 'non-controllers' it is meant any node for which
the corresponding roles_data.yaml role has the
disable_upgrade_deployment flag set True.

As a first pass, I am removing the workarounds from the script but
keeping its delivery mechanism for now in case it is needed still.
We can either update here to remove it or keep it until next cycle

The most important part for now is that we no longer 'manually'
run puppet here. Instead the post_deploy_steps are also collected
into a playbook and will be executed after the upgrade_tasks
(see the bug for discussion of the mechanism and related reviews)

Change-Id: Ib017b0ab435ca9558cf8659d434489cdf01df955
Related-Bug: 1708115
2017-08-29 14:29:37 +03:00

37 lines
949 B
Bash

#!/bin/bash
#
# This delivers the operator driven upgrade script to be invoked as part of
# the tripleo major upgrade workflow. The utility 'upgrade-non-controller.sh'
# is used from the undercloud to invoke the /root/tripleo_upgrade_node.sh
#
set -eu
UPGRADE_SCRIPT=/root/tripleo_upgrade_node.sh
cat > $UPGRADE_SCRIPT << ENDOFCAT
### DO NOT MODIFY THIS FILE
### This file is automatically delivered to those nodes where the
### disable_upgrade_deployment flag is set in roles_data.yaml.
set -eu
NOVA_COMPUTE=""
if hiera -c /etc/puppet/hiera.yaml service_names | grep nova_compute ; then
NOVA_COMPUTE="true"
fi
SWIFT_STORAGE=""
if hiera -c /etc/puppet/hiera.yaml service_names | grep swift_storage ; then
SWIFT_STORAGE="true"
fi
DEBUG="true"
SCRIPT_NAME=$(basename $0)
$(declare -f log_debug)
log_debug "$UPGRADE_SCRIPT has completed - moving onto ansible playbooks"
ENDOFCAT
# ensure the permissions are OK
chmod 0755 $UPGRADE_SCRIPT