From 386721c6a517493772284a0a78931cf518c86911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa?= Date: Thu, 5 Apr 2018 19:02:47 +0200 Subject: [PATCH 1/2] Retry when connecting to external services --- tasks/install.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/install.yml b/tasks/install.yml index 015c4e2..5e6dec6 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -32,6 +32,10 @@ dest: "/tmp" remote_src: yes creates: "/tmp/alertmanager-{{ alertmanager_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}/alertmanager" + register: _download_alertmanager + until: _download_alertmanager | success + retries: 5 + delay: 2 run_once: true delegate_to: localhost @@ -65,6 +69,10 @@ with_items: - libselinux-python - policycoreutils-python + register: _download_packages + until: _download_packages | success + retries: 5 + delay: 2 when: - ansible_os_family == "RedHat" From 8c7f071af98655071977923e410a505bdf08dafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa?= Date: Thu, 5 Apr 2018 19:05:23 +0200 Subject: [PATCH 2/2] consistent variable naming --- tasks/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 5e6dec6..85edc99 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -32,8 +32,8 @@ dest: "/tmp" remote_src: yes creates: "/tmp/alertmanager-{{ alertmanager_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}/alertmanager" - register: _download_alertmanager - until: _download_alertmanager | success + register: _download_binary + until: _download_binary | success retries: 5 delay: 2 run_once: true