From 871d4b9c322904143246ae8b00592c9c811fb2f8 Mon Sep 17 00:00:00 2001 From: git-harry Date: Mon, 14 Mar 2016 10:07:23 +0000 Subject: [PATCH] Fail when ansible-galaxy returns error Remove the --ignore-errors flag from the ansible-galaxy command used to pull in the roles required by the project. If a role fails to be installed, ignoring the error only moves the failure from bootstrap-ansible.sh to the playbooks. Adjust the ordering of the roles in the requirements file so that dependencies are installed before they are required. This is necessary because the roles are not on Ansible Galaxy. Modify tox.ini so that the functional testing does not ignore errors. Change-Id: Id68affada5cf2380b0388d45a9baf6b4839824c7 --- ansible-role-requirements.yml | 16 ++++++++-------- scripts/bootstrap-ansible.sh | 1 - tox.ini | 3 +-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index 9aa133b0fa..db717552de 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -2,6 +2,14 @@ src: https://git.openstack.org/openstack/openstack-ansible-apt_package_pinning scm: git version: master +- name: pip_install + src: https://git.openstack.org/openstack/openstack-ansible-pip_install + scm: git + version: master +- name: pip_lock_down + src: https://git.openstack.org/openstack/openstack-ansible-pip_lock_down + scm: git + version: master - name: galera_client src: https://git.openstack.org/openstack/openstack-ansible-galera_client scm: git @@ -85,14 +93,6 @@ src: https://git.openstack.org/openstack/openstack-ansible-os_tempest scm: git version: master -- name: pip_lock_down - src: https://git.openstack.org/openstack/openstack-ansible-pip_lock_down - scm: git - version: master -- name: pip_install - src: https://git.openstack.org/openstack/openstack-ansible-pip_install - scm: git - version: master - name: plugins src: https://git.openstack.org/openstack/openstack-ansible-plugins path: /etc/ansible diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index a5f8ab3fb7..d87478dce5 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -86,7 +86,6 @@ pip2 install $PIP_OPTS "${ANSIBLE_WORKING_DIR}" || pip install $PIP_OPTS "${ANSI if [ -f "${ANSIBLE_ROLE_FILE}" ];then # Pull all required roles. ansible-galaxy install --role-file=${ANSIBLE_ROLE_FILE} \ - --ignore-errors \ --force fi diff --git a/tox.ini b/tox.ini index 4237dca9a6..1bc887bae1 100644 --- a/tox.ini +++ b/tox.ini @@ -82,7 +82,6 @@ commands = ansible-galaxy install \ --role-file={envtmpdir}/ansible/ansible-role-requirements.yml \ --roles-path={envtmpdir}/ansible/roles \ - --ignore-errors \ --force; \ ansible-playbook -i 'localhost ansible-connection=local,' \ --syntax-check \ @@ -99,4 +98,4 @@ commands = {[testenv:bashate]commands} {[testenv:ansible-lint]commands} {[testenv:ansible-syntax]commands} - {[testenv:inventory]commands} \ No newline at end of file + {[testenv:inventory]commands}