Unset OSA-defined variables for bootstrap

We've introduced couple of new ENV vars that we define in
openstack-ansible.rc file. While they're working properly, we still don't
want them to be used during bootstrap process, as in case of
bootstrap failure somewhere in the middle of execution, like before
our plugins collection being installed, next bootstrap re-runs will fail
with smth like `Invalid play strategy specified: openstack.osa.linear`

In order to fix this we set default values for ANSIBLE_TRANSPORT and
ANSIBLE_STRATEGY that we clean out after bootstrap is completed.

Change-Id: Id34fb425c76bef7615bcbf1334d7a84ac6422fa8
This commit is contained in:
Dmitriy Rabotyagov 2022-12-20 18:11:25 +01:00
parent 36919af266
commit b6cf0973c6

View File

@ -202,6 +202,8 @@ if [ -f "${ANSIBLE_ROLE_FILE}" ] && [[ -z "${SKIP_OSA_ROLE_CLONE+defined}" ]]; t
export ANSIBLE_STRATEGY_PLUGINS="/dev/null"
export ANSIBLE_CONFIG="none-ansible.cfg"
export ANSIBLE_COLLECTIONS_PATH="/etc/ansible"
export ANSIBLE_TRANSPORT="smart"
export ANSIBLE_STRATEGY="linear"
pushd scripts
/opt/ansible-runtime/bin/ansible-playbook get-ansible-collection-requirements.yml \
@ -222,6 +224,8 @@ if [ -f "${ANSIBLE_ROLE_FILE}" ] && [[ -z "${SKIP_OSA_ROLE_CLONE+defined}" ]]; t
unset ANSIBLE_STRATEGY_PLUGINS
unset ANSIBLE_CONFIG
unset ANSIBLE_COLLECTIONS_PATH
unset ANSIBLE_TRANSPORT
unset ANSIBLE_STRATEGY
fi
echo "System is bootstrapped and ready for use."