tripleo-ansible/ansible-test-env.rc
Kevin Carter abcf3726aa Add local testing aids and documentation
This change adds contributing documentation to illustrate how
developers can test roles using molecule on local machines.
To assist in local testing an rc environment file has been
added to the project root which will ensure ansible is
configured to use resources out of this project.

Change-Id: I237f743aa85fac9eb56a4c7aac54a7545cc125db
Signed-off-by: Kevin Carter <kevin@cloudnull.com>
2019-07-01 12:35:21 +00:00

24 lines
1.2 KiB
Plaintext

export TRIPLEO_ANSIBLE_WORKPATH="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
export ANSIBLE_STDOUT_CALLBACK=debug
export ANSIBLE_ACTION_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/action"
export ANSIBLE_CALLBACK_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/callback"
export ANSIBLE_FILTER_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/filter"
export ANSIBLE_LIBRARY="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/modules"
export ANSIBLE_MODULE_UTILS="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/ansible_plugins/module_utils"
export ANSIBLE_ROLES_PATH="${TRIPLEO_ANSIBLE_WORKPATH}/tripleo_ansible/roles"
export ANSIBLE_INVENTORY="${TRIPLEO_ANSIBLE_WORKPATH}/tests/hosts.ini"
export ANSIBLE_RETRY_FILES_ENABLED="0"
export ANSIBLE_LOAD_CALLBACK_PLUGINS="1"
function unset-ansible-test-env {
for i in $(env | grep ANSIBLE_ | awk -F'=' '{print $1}'); do
unset ${i}
done
unset TRIPLEO_ANSIBLE_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"