From 03d2f664becbff9894b2103cd458decb670b4217 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 16 Jan 2018 10:46:49 -0600 Subject: [PATCH] Force ansible to ignore plugins when bootstrapping When ansible is bootstrapping an environment there can be conflicts with the ansible plugins we use by default, especially in the case of an upgrade. This change sets all of the plugin environment variables to /dev/null so that ansible ignores the existance of all plugins during the bootstrap process. Change-Id: I3b03e4c67c589eae528ad6400023c4247a5ca6e6 Closes-Bug: #1741221 Signed-off-by: Kevin Carter --- scripts/bootstrap-ansible.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index a387748196..9ae289f70c 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -286,12 +286,37 @@ if [ -f "${ANSIBLE_ROLE_FILE}" ]; then ansible-galaxy install --role-file="${ANSIBLE_ROLE_FILE}" \ --force elif [[ "${ANSIBLE_ROLE_FETCH_MODE}" == 'git-clone' ]];then + # NOTE(cloudnull): When bootstrapping we don't want ansible to interact + # with our plugins by default. This change will force + # ansible to ignore our plugins during this process. + export ANSIBLE_LIBRARY="/dev/null" + export ANSIBLE_LOOKUP_PLUGINS="/dev/null" + export ANSIBLE_FILTER_PLUGINS="/dev/null" + export ANSIBLE_ACTION_PLUGINS="/dev/null" + export ANSIBLE_CALLBACK_PLUGINS="/dev/null" + export ANSIBLE_CALLBACK_WHITELIST="/dev/null" + export ANSIBLE_TEST_PLUGINS="/dev/null" + export ANSIBLE_VARS_PLUGINS="/dev/null" + export ANSIBLE_STRATEGY_PLUGINS="/dev/null" + export ANSIBLE_CONFIG="none-ansible.cfg" + pushd tests /opt/ansible-runtime/bin/ansible-playbook get-ansible-role-requirements.yml \ -i ${OSA_CLONE_DIR}/tests/test-inventory.ini \ -e role_file="${ANSIBLE_ROLE_FILE}" \ -vvv popd + + unset ANSIBLE_LIBRARY + unset ANSIBLE_LOOKUP_PLUGINS + unset ANSIBLE_FILTER_PLUGINS + unset ANSIBLE_ACTION_PLUGINS + unset ANSIBLE_CALLBACK_PLUGINS + unset ANSIBLE_CALLBACK_WHITELIST + unset ANSIBLE_TEST_PLUGINS + unset ANSIBLE_VARS_PLUGINS + unset ANSIBLE_STRATEGY_PLUGINS + unset ANSIBLE_CONFIG else echo "Please set the ANSIBLE_ROLE_FETCH_MODE to either of the following options ['galaxy', 'git-clone']" exit 99