Skip to content

Commit e024397

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "toolbox: Improve retry loop for ansible-galaxy"
2 parents f4edc7e + 94bd013 commit e024397

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docker/kolla-toolbox/Dockerfile.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ RUN {{ macros.install_pip(['pip', 'wheel', 'setuptools']) }} \
8585

8686
{% block kolla_toolbox_collections_install %}
8787
COPY requirements.yml /var/lib/ansible/
88-
RUN for i in {1..5}; do ansible-galaxy collection install --timeout 120 -p /usr/share/ansible/collections -r /var/lib/ansible/requirements.yml \
89-
&& break || sleep 15; done
88+
RUN fail=1; for i in $(seq 1 5); do if \
89+
ansible-galaxy collection install --timeout 120 -p /usr/share/ansible/collections -r /var/lib/ansible/requirements.yml \
90+
; then fail=0; break; fi; echo "Collection download failed, retrying"; sleep 5; done; \
91+
if [ "$fail" -eq 1 ]; then exit 1; fi
9092

9193
ENV ANSIBLE_LIBRARY /usr/share/ansible:$ANSIBLE_LIBRARY
9294
{% endblock %}

0 commit comments

Comments
 (0)