From 77bb885d072f7f8b026f5f5fe12a5a6f51d51c9e Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 15 Oct 2020 18:22:13 +0300 Subject: [PATCH] Make collections installation more reliable Installing collections with ansible-galaxy is causing a large number of CI job failures [1]. This patch switches collections installation to github from galaxy for supported collections, and adding retry for task itself. [1] http://paste.openstack.org/show/799081/ Change-Id: Ib61be19b815882ec2167d452b78565ea78c5284c --- ansible-collection-requirements.yml | 26 ++++++++++--------- scripts/bootstrap-ansible.sh | 2 +- .../get-ansible-collection-requirements.yml | 5 +++- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ansible-collection-requirements.yml b/ansible-collection-requirements.yml index 48bae11c60..7ccea357b7 100644 --- a/ansible-collection-requirements.yml +++ b/ansible-collection-requirements.yml @@ -1,19 +1,21 @@ collections: + # NOTE(noonedeadpunk): needs galaxy.yml to be able to pull from git - name: openstack.cloud - version: 1.0.0 + version: 1.2.0 source: https://galaxy.ansible.com - - name: community.general - version: 1.1.0 - source: https://galaxy.ansible.com - - name: community.rabbitmq + - name: https://github.com/ansible-collections/community.general + version: 1.2.0 + type: git + - name: https://github.com/ansible-collections/community.rabbitmq version: 1.0.1 - source: https://galaxy.ansible.com - - name: community.mysql - version: 1.0.0 - source: https://galaxy.ansible.com - - name: community.crypto - version: 1.1.1 - source: https://galaxy.ansible.com + type: git + - name: https://github.com/ansible-collections/community.mysql + version: 1.1.0 + type: git + - name: https://github.com/ansible-collections/community.crypto + version: 1.2.0 + type: git + # NOTE(noonedeadpunk): needs version in galaxy.yml to pull from git - name: openvswitch.openvswitch version: 1.0.5 source: https://galaxy.ansible.com diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index 2fa9f06fac..fdfeddb101 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -22,7 +22,7 @@ set -e -u -x export HTTP_PROXY=${HTTP_PROXY:-""} export HTTPS_PROXY=${HTTPS_PROXY:-""} # The Ansible version used for testing -export ANSIBLE_PACKAGE=${ANSIBLE_PACKAGE:-"ansible-base==2.10.1"} +export ANSIBLE_PACKAGE=${ANSIBLE_PACKAGE:-"ansible-base==2.10.2"} export ANSIBLE_ROLE_FILE=${ANSIBLE_ROLE_FILE:-"ansible-role-requirements.yml"} export ANSIBLE_COLLECTION_FILE=${ANSIBLE_COLLECTION_FILE:-"ansible-collection-requirements.yml"} export USER_ROLE_FILE=${USER_ROLE_FILE:-"user-role-requirements.yml"} diff --git a/scripts/get-ansible-collection-requirements.yml b/scripts/get-ansible-collection-requirements.yml index aa7dfb70ba..5c7d66110b 100644 --- a/scripts/get-ansible-collection-requirements.yml +++ b/scripts/get-ansible-collection-requirements.yml @@ -53,10 +53,13 @@ - name: Install collection requirements with ansible galaxy command: > - /opt/ansible-runtime/bin/ansible-galaxy collection install + /opt/ansible-runtime/bin/ansible-galaxy collection install --force -r "{{ collection_requirements_tmpfile.path }}" -p "{{ collection_path_default }}" register: collection_install + until: collection_install is success + retries: 5 + delay: 2 - name: Show collection install output debug: msg="{{ collection_install.stdout.split('\n') }}"