From beb9f6ac6ade9962991643c3ae7cbe1cbabaca44 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Sat, 16 Jun 2018 19:14:45 -0400 Subject: [PATCH] Add retries to package installations Change-Id: Ifc1e3be7cfec4e6447c32fbf7b8f7c87010da679 --- tests/test.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test.yml b/tests/test.yml index 1d2526c3..5a9174a0 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -20,8 +20,13 @@ apt: update_cache: yes cache_valid_time: "{{ cache_timeout }}" - when: ansible_pkg_mgr == 'apt' changed_when: False + when: + - ansible_pkg_mgr == 'apt' + register: refresh_cache + until: refresh_cache is success + retries: 5 + delay: 2 - name: Ensure OpenStack CI image has a logrotate cron job file: path: /etc/cron.daily/logrotate @@ -32,8 +37,13 @@ package: name: dconf state: installed - when: ansible_os_family == 'RedHat' changed_when: False + when: + - ansible_os_family == 'RedHat' + register: install_packages + until: install_packages is success + retries: 5 + delay: 2 roles: - role: "ansible-hardening" vars: