toolbox: Improve retry loop for ansible-galaxy
Currently if it somehow fails for 5 times - we get exit code 0.
Closes-Bug: #2052293
Change-Id: I2bdeb77e3133123053b05adcbde3a426c60f3304
(cherry picked from commit 94bd013ed5
)
This commit is contained in:
parent
24b31bff55
commit
9eb088b630
@ -90,7 +90,10 @@ RUN {{ macros.install_pip(['pip', 'wheel', 'setuptools']) }} \
|
||||
|
||||
{% block kolla_toolbox_collections_install %}
|
||||
COPY requirements.yml /var/lib/ansible/
|
||||
RUN ansible-galaxy collection install -p /usr/share/ansible/collections -r /var/lib/ansible/requirements.yml
|
||||
RUN fail=1; for i in $(seq 1 5); do if \
|
||||
ansible-galaxy collection install -p /usr/share/ansible/collections -r /var/lib/ansible/requirements.yml \
|
||||
; then fail=0; break; fi; echo "Collection download failed, retrying"; sleep 5; done; \
|
||||
if [ "$fail" -eq 1 ]; then exit 1; fi
|
||||
|
||||
ENV ANSIBLE_LIBRARY /usr/share/ansible:$ANSIBLE_LIBRARY
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user