Takashi Kajinami 4a4bd9c06a overcloud: Remove logic for unsupported old releases
This change removes logic for releases older than train, because these
releases are already EOLed. This covers only overcloud-* roles and
playbooks and the other items will be covered by separate changes.

Note that this change also removes the containerized_* variables
because current active releases(>=Train) no longer supports
non-containerized deployment. The containerized_overcloud_upgrade
variable is still left because the variable is still required by
the tripleo-ci-base-multinode-standard job template.

Change-Id: If29ec2c2219a28a1f79db0e552e2c622c0a7bda6
2022-10-25 16:32:53 +09:00

66 lines
2.6 KiB
Django/Jinja

#!/bin/bash
set -ux
### --start_docs
## Deploying the overcloud
## =======================
## Prepare Your Environment
## ------------------------
## * Source in the undercloud credentials.
## ::
source {{ working_dir }}/stackrc
## * Deploy the overcloud!
## ::
openstack overcloud deploy --stack {{ stack_name }} \
--override-ansible-cfg {{ working_dir }}/custom_ansible.cfg \
--templates {{overcloud_templates_path}} \
{{ deploy_args | regex_replace("\n", " ") }} \
"$@" && status_code=0 || status_code=$?
### --stop_docs
{% if not (ephemeral_heat|default(false)|bool) %}
# Check if the deployment has started. If not, exit gracefully. If yes, check for errors.
if ! openstack stack list | grep -q {{ stack_name }}; then
echo "overcloud deployment not started. Check the deploy configurations"
exit 1
# We don't always get a useful error code from the openstack deploy command,
# so check `openstack stack list` for a CREATE_COMPLETE or an UPDATE_COMPLETE
# status.
elif ! openstack stack list | grep -Eq '(CREATE|UPDATE)_COMPLETE'; then
# get the failures list
openstack stack failures list {{ stack_name }} --long > {{ failed_deployment_list }} || true
# get any puppet related errors
for failed in $(openstack stack resource list \
--nested-depth 5 {{ stack_name }} | grep FAILED |
grep 'StructuredDeployment ' | cut -d '|' -f3)
do
echo "openstack software deployment show output for deployment: $failed" >> {{ failed_deployments_log }}
echo "######################################################" >> {{ failed_deployments_log }}
openstack software deployment show $failed >> {{ failed_deployments_log }}
echo "######################################################" >> {{ failed_deployments_log }}
echo "puppet standard error for deployment: $failed" >> {{ failed_deployments_log }}
echo "######################################################" >> {{ failed_deployments_log }}
# the sed part removes color codes from the text
openstack software deployment show $failed -f json |
jq -r .output_values.deploy_stderr |
sed -r "s:\x1B\[[0-9;]*[mK]::g" >> {{ failed_deployments_log }}
echo "######################################################" >> {{ failed_deployments_log }}
# We need to exit with 1 because of the above || true
done
exit 1
elif ! openstack overcloud status --plan {{ stack_name }} | grep -Eq 'DEPLOY_SUCCESS'; then
# NOTE(emilien) "openstack overcloud failures" was introduced in Rocky
openstack overcloud failures --plan {{ stack_name }} >> {{ failed_deployment_list }} || true
fi
{% endif %}
exit $status_code