Resolve common roles required for test
This change adds a common test role requirements file to the preparation process whch will ensure all required common roles are available prior to running tests. As we move to use common roles throughout our deliverables this change will help ensure we're not having to map complex common dependencies throughout our supported roles, which is prone to human error and can cause cascading failures throughout out stack should a requirement be missed. Change-Id: If3c57d5c864aee3a6bc461dead367eac7f3eede2 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
748e3d2292
commit
9938ef14eb
@ -176,15 +176,22 @@ fi
|
||||
|
||||
# Download the Ansible role repositories if they are not present on the host.
|
||||
# This is ignored if there is no ansible-role-requirements file.
|
||||
if [ ! -d "${ANSIBLE_ROLE_DEP_DIR}" ] && [ -f "${ANSIBLE_ROLE_REQUIREMENTS_PATH}" ]; then
|
||||
ansible-playbook -i ${ANSIBLE_INVENTORY} \
|
||||
${COMMON_TESTS_PATH}/get-ansible-role-requirements.yml \
|
||||
-v
|
||||
if [[ ! -e "${ANSIBLE_ROLE_DEP_DIR}/plugins" ]]; then
|
||||
ln -s "${ANSIBLE_PLUGIN_DIR}" "${ANSIBLE_ROLE_DEP_DIR}/plugins"
|
||||
fi
|
||||
fi
|
||||
if [[ ! -d "${ANSIBLE_ROLE_DEP_DIR}" ]]; then
|
||||
# Download the common test Ansible role repositories.
|
||||
ANSIBLE_ROLE_REQUIREMENTS_PATH=${COMMON_TESTS_PATH}/test-ansible-role-requirements.yml \
|
||||
ansible-playbook -i ${ANSIBLE_INVENTORY} \
|
||||
${COMMON_TESTS_PATH}/get-ansible-role-requirements.yml \
|
||||
-v
|
||||
|
||||
if [[ -f "${ANSIBLE_ROLE_REQUIREMENTS_PATH}" ]]; then
|
||||
ansible-playbook -i ${ANSIBLE_INVENTORY} \
|
||||
${COMMON_TESTS_PATH}/get-ansible-role-requirements.yml \
|
||||
-v
|
||||
if [[ ! -e "${ANSIBLE_ROLE_DEP_DIR}/plugins" ]]; then
|
||||
ln -s "${ANSIBLE_PLUGIN_DIR}" "${ANSIBLE_ROLE_DEP_DIR}/plugins"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# If a role name is provided, replace the role in the roles folder with a link
|
||||
# to the current folder. This ensures that the test executes with the checked
|
||||
|
17
test-ansible-role-requirements.yml
Normal file
17
test-ansible-role-requirements.yml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: systemd_service
|
||||
src: https://git.openstack.org/openstack/ansible-role-systemd_service
|
||||
scm: git
|
||||
version: master
|
||||
- name: systemd_mount
|
||||
src: https://git.openstack.org/openstack/ansible-role-systemd_mount
|
||||
scm: git
|
||||
version: master
|
||||
- name: systemd_networkd
|
||||
src: https://git.openstack.org/openstack/ansible-role-systemd_networkd
|
||||
scm: git
|
||||
version: master
|
||||
- name: python_venv_build
|
||||
src: https://git.openstack.org/openstack/ansible-role-python_venv_build
|
||||
scm: git
|
||||
version: master
|
Loading…
Reference in New Issue
Block a user