diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2024-02-02 14:26:02 +0100 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2024-02-26 10:20:14 +0000 |
| commit | 9eb088b63020ba22b1950eb6b248150721098b9c (patch) | |
| tree | 03234dfa332a834d9b38e0e7ee908a606844f887 | |
| parent | 24b31bff55dc05228cbf2e8e9e360d565838e3fa (diff) | |
| download | kolla-9eb088b63020ba22b1950eb6b248150721098b9c.tar.gz kolla-9eb088b63020ba22b1950eb6b248150721098b9c.zip | |
toolbox: Improve retry loop for ansible-galaxy15.6.0
Currently if it somehow fails for 5 times - we get exit code 0.
Closes-Bug: #2052293
Change-Id: I2bdeb77e3133123053b05adcbde3a426c60f3304
(cherry picked from commit 94bd013ed55fd79bc4bfa33121c823927ec40b56)
| -rw-r--r-- | docker/kolla-toolbox/Dockerfile.j2 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2 index 06be9325d..19b8a3796 100644 --- a/docker/kolla-toolbox/Dockerfile.j2 +++ b/docker/kolla-toolbox/Dockerfile.j2 @@ -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 %} |
