#!/bin/env bash
#
# Setup HEAT's output
#
set -euo pipefail

source {{undercloud_rc }}

echo "Setting up HEAT's output for major upgrade"
openstack overcloud upgrade prepare --templates --stack {{ overcloud_stack_name }} \
    {% if tripleo_upgrade_debug|bool %}
    --debug \
    {% endif %}
    {% if tripleo_upgrade_skip_validations|bool %}
    --validation-errors-nonfatal \
    {% endif %}
    --container-registry-file {{ working_dir }}/{{ container_registry_file }} \
    {% if upgrade_prepare_extra_params %}
    -e {{ upgrade_prepare_extra_params | join(' -e ') }} \
    {% endif %}
    -e {{ tht_directory }}/environments/noop-deploy-steps.yaml 2>&1
