tripleo-upgrade/templates/overcloud_update_prepare.sh.j2

63 lines
2.1 KiB
Django/Jinja

#!/bin/env bash
#
# Setup HEAT's output
#
set -eu
PREPARE_ANSWER=""
if openstack overcloud update prepare --help | grep -qe "--yes"; then
PREPARE_ANSWER="--yes"
fi
set -o pipefail
# FIXME: Remove --validation-errors-nonfatal. In local testing it was
# not necessary but in RDO cloud validations seem to produce errors.
echo "Setting up HEAT's output for minor update"
openstack overcloud update prepare ${PREPARE_ANSWER} \
--templates {{ tht_directory }} \
--stack {{ overcloud_stack_name }} \
{% if overcloud_ssh_user != '' -%}
--overcloud-ssh-user {{ overcloud_ssh_user }} \
{% endif -%}
{% if splitstack_deployment|bool -%}
--disable-validations \
--deployed-server \
{% endif -%}
{% if tripleo_upgrade_debug|bool -%}
--debug \
{% endif -%}
{% if tripleo_upgrade_validations_non_fatal|bool -%}
--validation-errors-nonfatal \
{% endif -%}
{% if network_data_file|length >0 -%}
-n {{ network_data_file }} \
{% endif -%}
{% if initial_env_file is defined and initial_env_file.stdout_lines|length > 0 -%}
{% for _env in initial_env_file.stdout_lines|difference(old_img|default([])) -%}
-e {{ _env }} \
{% endfor -%}
{% endif -%}
{% if cli_converted_options|default(false)|bool -%}
-e {{working_dir}}/cli_opts_params.yaml \
{% endif -%}
{% if not ( enforce_rhel|bool ) -%}
-e {{ working_dir }}/skip_rhel_release.yaml \
{% endif -%}
{% if config_heat_extra_yaml is defined -%}
-e {{ working_dir }}/{{ install.deployment.files | basename }}/config_heat_extra.yaml \
{% endif -%}
{% if mixed_os|default(false)|bool -%}
--disable-protected-resource-types \
--baremetal-deployment \
{% endif -%}
{% if rhsm_overcloud_env != '' -%}
{# adding rhsm at the end so it overrides any other rhsm params passed. -#}
-e /usr/share/openstack-tripleo-heat-templates/environments/rhsm.yaml \
-e {{ rhsm_overcloud_env }} \
{% endif -%}
{% if roles_data != default_roles_data -%}
--roles-file {{ roles_data }} \
{% endif -%}
{{ extra_args }} \
2>&1