#!/bin/bash set -ux ### --start_docs ## Deploying the overcloud ## ======================= ## Prepare Your Environment ## ------------------------ ## * Source in the undercloud credentials. ## :: source /home/zuul/stackrc ### --start_docs ## * Deploy the overcloud! ## :: openstack overcloud deploy --override-ansible-cfg /home/zuul/custom_ansible.cfg \ --templates /usr/share/openstack-tripleo-heat-templates \ --libvirt-type qemu --timeout 90 -e /home/zuul/cloud-names.yaml -e /home/zuul/hostnamemap.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-environment.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-bootstrap-environment-centos.yaml --overcloud-ssh-user zuul -e /home/zuul/containers-prepare-parameter.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml -e /usr/share/openstack-tripleo-heat-templates/ci/environments/scenario000-multinode-containers.yaml -e /home/zuul/overcloud_network_params.yaml -e /home/zuul/overcloud_storage_params.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml -e /home/zuul/src/opendev.org/openstack/tripleo-ci/test-environments/worker-config.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/debug.yaml --validation-errors-nonfatal --roles-file /home/zuul/overcloud_roles.yaml -e /home/zuul/overcloud-topology-config.yaml -e /home/zuul/config-download.yaml --disable-validations --verbose -e /home/zuul/overcloud-selinux-config.yaml \ "$@" && status_code=0 || status_code=$? ### --stop_docs # Check if the deployment has started. If not, exit gracefully. If yes, check for errors. if ! openstack stack list | grep -q overcloud; 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 overcloud --long > /home/zuul/failed_deployment_list.log || true # get any puppet related errors for failed in $(openstack stack resource list \ --nested-depth 5 overcloud | grep FAILED | grep 'StructuredDeployment ' | cut -d '|' -f3) do echo "openstack software deployment show output for deployment: $failed" >> /home/zuul/failed_deployments.log echo "######################################################" >> /home/zuul/failed_deployments.log openstack software deployment show $failed >> /home/zuul/failed_deployments.log echo "######################################################" >> /home/zuul/failed_deployments.log echo "puppet standard error for deployment: $failed" >> /home/zuul/failed_deployments.log echo "######################################################" >> /home/zuul/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" >> /home/zuul/failed_deployments.log echo "######################################################" >> /home/zuul/failed_deployments.log # We need to exit with 1 because of the above || true done exit 1 elif ! openstack overcloud status | grep -Eq 'DEPLOY_SUCCESS'; then # NOTE(emilien) "openstack overcloud failures" was introduced in Rocky openstack overcloud failures >> /home/zuul/failed_deployment_list.log || true fi exit $status_code