Makes buildah retries more verbose

As we found that buildah may fail with litterary no output we need
to be sure that retries happen with more verbosity, so we can identify
what caused the failure.

Change-Id: I6ed857a827d129d99b5826d6c3afbc9d7c71d501
Example: http://logs.openstack.org/60/636860/7/check/tripleo-ci-fedora-28-standalone/2565b12/logs/undercloud/var/log/tripleo-container-image-prepare.log.txt.gz
This commit is contained in:
Sorin Sbarnea 2019-06-19 14:03:23 +01:00
parent 8befbdbe5a
commit 8b366d2a27
1 changed files with 36 additions and 18 deletions

View File

@ -34,24 +34,42 @@
chdir: "{{ yum_repos_dir_path }}"
register: file_repos
- name: Run yum_update.sh
command: >
buildah run
--volume {{ yum_update.path }}:/tmp/yum_update.sh
--volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
{% for repo in file_repos.stdout_lines %}
{% if repo|exists %}
--volume {{ repo }}:{{ repo }}
{% endif %}
{% endfor %}
--user root
--net host
{{ from_image }}
/tmp/yum_update.sh "{{ update_repo }}"
retries: 3
delay: 3
register: result
until: result.rc == 0
- block:
- name: Run yum_update.sh
command: >
buildah run
--volume {{ yum_update.path }}:/tmp/yum_update.sh
--volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
{% for repo in file_repos.stdout_lines %}
{% if repo|exists %}
--volume {{ repo }}:{{ repo }}
{% endif %}
{% endfor %}
--user root
--net host
{{ from_image }}
/tmp/yum_update.sh "{{ update_repo }}"
register: result
rescue:
- name: Run yum_update.sh (retry)
command: >
buildah --debug run
--volume {{ yum_update.path }}:/tmp/yum_update.sh
--volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
{% for repo in file_repos.stdout_lines %}
{% if repo|exists %}
--volume {{ repo }}:{{ repo }}
{% endif %}
{% endfor %}
--user root
--net host
{{ from_image }}
bash -x /tmp/yum_update.sh "{{ update_repo }}"
retries: 2
delay: 3
register: result
until: result.rc == 0
- name: Remove temporary yum_update.sh script
file: