diff --git a/t/scenarios/_common/ansible/roles/yum_apt_retry/tasks/main.yml b/t/scenarios/_common/ansible/roles/yum_apt_retry/tasks/main.yml index 6a5f072e0..ace7026a4 100644 --- a/t/scenarios/_common/ansible/roles/yum_apt_retry/tasks/main.yml +++ b/t/scenarios/_common/ansible/roles/yum_apt_retry/tasks/main.yml @@ -1,15 +1,16 @@ --- - name: "package yum/apt retry installer: {{ package | join(' ') }} {{ rpm | join(' ') }} {{ deb | join(' ') }}" shell: | - set -x - allfound=1 - for file in {{ creates | join(' ') }}; do - if ! test -e $file; then - allfound=0 + if [ "{{ creates | join(' ') }}" != "" ]; then + allfound=1 + for file in {{ creates | join(' ') }}; do + if ! test -e $file; then + allfound=0 + fi + done + if [ $allfound -eq 1 ]; then + exit 0 fi - done - if [ $allfound -eq 1 ]; then - exit 0 fi if test -f /usr/bin/apt; then apt-get install -y {{ package | join(' ') }} {{ deb | join(' ') }}