Add retries for packages installation

Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya 2016-09-13 15:29:22 +02:00
parent 6fdcaa1a63
commit 783871a253
2 changed files with 12 additions and 0 deletions

View file

@ -27,6 +27,10 @@
id: "{{item}}"
keyserver: "{{docker_repo_key_info.keyserver}}"
state: present
register: keyserver_task_result
until: keyserver_task_result|success
retries: 4
delay: "{{ 20 | random + 3 }}"
with_items: "{{ docker_repo_key_info.repo_keys }}"
when: ansible_os_family != "CoreOS"
@ -51,6 +55,10 @@
pkg: "{{item.name}}"
force: "{{item.force|default(omit)}}"
state: present
register: docker_task_result
until: docker_task_result|success
retries: 4
delay: "{{ 20 | random + 3 }}"
with_items: "{{ docker_package_info.pkgs }}"
when: (ansible_os_family != "CoreOS") and (docker_package_info.pkgs|length > 0)

View file

@ -101,6 +101,10 @@
module: "{{ ansible_pkg_mgr }}"
name: "{{ item }}"
state: latest
register: pkgs_task_result
until: pkgs_task_result|success
retries: 4
delay: "{{ 20 | random + 3 }}"
with_items: "{{required_pkgs | default([]) | union(common_required_pkgs|default([]))}}"
when: ansible_os_family != "CoreOS"