From 2eaaa4b0c51698afe704008437f29cb47827290a Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 26 Jan 2022 10:06:44 +0200 Subject: [PATCH] Fix infra upgrade Since we launch upgrade script from another bash script, we don't really alter environmental variables, which remain to be defined in scope of gate-check-commit. So we explicitly unset them and re-using unset Change-Id: I2e41323cc8dbd0e93679de9360ad6359ab90710b --- scripts/gate-check-commit.sh | 4 ++++ scripts/run-upgrade.sh | 8 +------- scripts/upgrade-utilities/unset-ansible-env.rc | 7 +++++++ 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 scripts/upgrade-utilities/unset-ansible-env.rc diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index 83689c0511..2ac9409d08 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -262,6 +262,10 @@ if [[ "${ACTION}" == "upgrade" ]]; then echo 'YES' | bash "${OSA_CLONE_DIR}/scripts/run-upgrade.sh" if [[ $SCENARIO =~ "infra" ]]; then + # TODO(noonedeadpunk): Remove after Y release + set -a + . ${OSA_CLONE_DIR}/scripts/upgrade-utilities/unset-ansible-env.rc + set +a # Verify our infra setup after upgrade openstack-ansible ${OSA_CLONE_DIR}/playbooks/healthcheck-infrastructure.yml -e osa_gather_facts=False fi diff --git a/scripts/run-upgrade.sh b/scripts/run-upgrade.sh index 6d33874261..f5082f2203 100755 --- a/scripts/run-upgrade.sh +++ b/scripts/run-upgrade.sh @@ -166,13 +166,7 @@ function main { unset ANSIBLE_INVENTORY # TODO(noonedeadpunk): Remove after Y release - unset ANSIBLE_LIBRARY - unset ANSIBLE_FILTER_PLUGINS - unset ANSIBLE_ACTION_PLUGINS - unset ANSIBLE_CALLBACK_PLUGINS - unset ANSIBLE_TRANSPORT - unset ANSIBLE_STRATEGY_PLUGINS - unset ANSIBLE_CONNECTION_PLUGINS + source ${SCRIPTS_PATH}/upgrade-utilities/unset-ansible-env.rc bootstrap_ansible diff --git a/scripts/upgrade-utilities/unset-ansible-env.rc b/scripts/upgrade-utilities/unset-ansible-env.rc new file mode 100644 index 0000000000..ea039ab190 --- /dev/null +++ b/scripts/upgrade-utilities/unset-ansible-env.rc @@ -0,0 +1,7 @@ +unset ANSIBLE_LIBRARY +unset ANSIBLE_FILTER_PLUGINS +unset ANSIBLE_ACTION_PLUGINS +unset ANSIBLE_CALLBACK_PLUGINS +unset ANSIBLE_TRANSPORT +unset ANSIBLE_STRATEGY_PLUGINS +unset ANSIBLE_CONNECTION_PLUGINS