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: I60d17d3cae97aed3d9bfd26652ef6306a678399c Partial-Bug: #1750656
This commit is contained in:
parent
b04b48bc7f
commit
2ca6683653
|
@ -25,6 +25,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
|
||||
|
||||
- name: Install apt packages
|
||||
apt:
|
||||
|
|
Loading…
Reference in New Issue