tripleo-upgrade/molecule/ansible-test-env.rc
Carlos Camacho 505fc0d21e Introduce molecule tests in the tripleo-upgrade role
This patch adds the first structure to
run molecule and test this role

It includes a basic escenario to run the tripleo-upgrade
role without parameters.

Change-Id: I5b569ef8dca549581c918ee6bbde1234c68aa5a6
2019-11-19 11:01:10 +01:00

27 lines
1.5 KiB
Plaintext

export TRIPLEO_UPGRADE_WORKPATH="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
export ANSIBLE_STDOUT_CALLBACK=debug
export ANSIBLE_ACTION_PLUGINS="${TRIPLEO_UPGRADE_WORKPATH}/molecule/roles.galaxy/config_template/action:${TRIPLEO_UPGRADE_WORKPATH}/molecule/ansible_plugins/action"
export ANSIBLE_CALLBACK_PLUGINS="${TRIPLEO_UPGRADE_WORKPATH}/molecule/ansible_plugins/callback"
export ANSIBLE_FILTER_PLUGINS="${TRIPLEO_UPGRADE_WORKPATH}/molecule/ansible_plugins/filter"
export ANSIBLE_LIBRARY="${TRIPLEO_UPGRADE_WORKPATH}/molecule/roles.galaxy/config_template/library:${TRIPLEO_UPGRADE_WORKPATH}/molecule/ansible_plugins/modules"
export ANSIBLE_MODULE_UTILS="${TRIPLEO_UPGRADE_WORKPATH}/molecule/ansible_plugins/module_utils"
export ANSIBLE_ROLES_PATH="${TRIPLEO_UPGRADE_WORKPATH}/molecule/roles.galaxy:${TRIPLEO_UPGRADE_WORKPATH}"
export ANSIBLE_INVENTORY="${TRIPLEO_UPGRADE_WORKPATH}/molecule/tests/hosts.ini"
export ANSIBLE_RETRY_FILES_ENABLED="0"
export ANSIBLE_LOAD_CALLBACK_PLUGINS="1"
export ANSIBLE_HOST_KEY_CHECKING=False
export ANSIBLE_LOCAL_TEMP="${TRIPLEO_UPGRADE_WORKPATH}/tmp/"
export ANSIBLE_REMOTE_TEMP="${TRIPLEO_UPGRADE_WORKPATH}/tmp/"
function unset-ansible-test-env {
for i in $(env | grep ANSIBLE_ | awk -F'=' '{print $1}'); do
unset ${i}
done
unset TRIPLEO_UPGRADE_WORKPATH
echo -e "Ansible test environment deactivated.\n"
unset -f unset-ansible-test-env
}
echo -e "Ansible test environment is now active"
echo -e "Run 'unset-ansible-test-env' to deactivate.\n"