diff --git a/test-ansible-env-prep.sh b/test-ansible-env-prep.sh index 0dff00f7..a1ebb57b 100755 --- a/test-ansible-env-prep.sh +++ b/test-ansible-env-prep.sh @@ -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 diff --git a/test-ansible-role-requirements.yml b/test-ansible-role-requirements.yml new file mode 100644 index 00000000..adbfb12a --- /dev/null +++ b/test-ansible-role-requirements.yml @@ -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