From 206dbf51146289fc5c1bbbe6581f4d172578e5d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa?= Date: Thu, 5 Apr 2018 18:43:32 +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 49d44a38..854be9ab 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -41,6 +41,10 @@ dest: "/tmp" remote_src: yes creates: "/tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}/prometheus" + register: _download_prometheus + until: _download_prometheus | success + retries: 5 + delay: 2 run_once: true delegate_to: localhost check_mode: no @@ -85,6 +89,10 @@ with_items: - libselinux-python - policycoreutils-python + register: _download_packages + until: _download_packages | success + retries: 5 + delay: 2 when: - ansible_os_family == "RedHat" From 4881c3ff7ae7697dcb61ba5f3dc0baa793eb9a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa?= Date: Thu, 5 Apr 2018 19:04:54 +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 854be9ab..aae3bfa8 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -41,8 +41,8 @@ dest: "/tmp" remote_src: yes creates: "/tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}/prometheus" - register: _download_prometheus - until: _download_prometheus | success + register: _download_binary + until: _download_binary | success retries: 5 delay: 2 run_once: true