Add retries to apt cache update
Updating the apt cache sometimes fails due to it being an operation that uses mirrors on the internet. The task should be retried to reduce the chance of a transient failure causing the playbook to fail. Change-Id: Ie23891b3fd8d8503044769a51b9b3fc5caf02eba Partial-Bug: #1750656
This commit is contained in:
parent
684601b9af
commit
4f6c0f1053
|
@ -27,6 +27,10 @@
|
|||
apt:
|
||||
update_cache: yes
|
||||
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
|
||||
register: update_apt_cache
|
||||
until: update_apt_cache | success
|
||||
retries: 5
|
||||
delay: 2
|
||||
tags:
|
||||
- galera-apt-packages
|
||||
|
||||
|
@ -120,6 +124,10 @@
|
|||
when: >
|
||||
"ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}" or
|
||||
add_galera_repo | changed or add_percona_repo | changed
|
||||
register: update_apt_cache
|
||||
until: update_apt_cache | success
|
||||
retries: 5
|
||||
delay: 2
|
||||
tags:
|
||||
- galera-apt-packages
|
||||
|
||||
|
|
Loading…
Reference in New Issue