tripleo-upgrade/templates/collect_logs.sh.j2
mciecier 8b7ca2c0ea Skip ceph update run when update is not required
Improve ceph update run tasks by detecting if ceph update is required
to not start ceph update to the same version. Also exclude ceph images
from container check when update of those containers is not happening.

Change-Id: Idd4132c75208b635c9bf06e28457e02aeb314708
(cherry picked from commit 0fd72e2100)
(cherry picked from commit 0f06dd64e4)
2023-02-28 15:09:31 +01:00

26 lines
939 B
Django/Jinja

#!/usr/bin/bash
#
# Script to collect some logs during update stages.
CURRENT_STAGE=${1:-{{ log_current_stage }}}
SSH_USER={{ (overcloud_ssh_user) | ternary(overcloud_ssh_user, 'tripleo-admin') }}
EXCLUDED_CONTAINERS_FROM_CHECK=${2:-{{ excluded_containers_from_check }}}
# This should always be true for tripleo>=wallaby.
if [ ! -f {{ upgrade_validation_inventory }} ]; then
# Then we create one for tripleo<wallaby.
INVENTORY="${HOME}/inventory.yaml"
if [ ! -f "${INVENTORY}" ]; then
. $HOME/stackrc
tripleo-ansible-inventory \
--plan "{{ overcloud_stack_name }}" \
--ansible_ssh_user ${SSH_USER} \
--static-yaml-inventory \
"${INVENTORY}"
fi
else
INVENTORY={{ upgrade_validation_inventory }}
fi
ansible-playbook -i "${INVENTORY}" -e current_stage="${CURRENT_STAGE}" -e containers_check_excluded="${EXCLUDED_CONTAINERS_FROM_CHECK}" {{ log_playbook }}