From c9be894c8dff96e9ad6644001245102e5b6e7b38 Mon Sep 17 00:00:00 2001 From: Eugene Chepurniy Date: Tue, 7 Jun 2022 08:27:05 +0300 Subject: [PATCH] refactor(init.sls): apply pkg.installed retries Co-authored-by: Eugene Chepurniy --- epel/init.sls | 1 + epel/map.jinja | 6 ++++++ pillar.example | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/epel/init.sls b/epel/init.sls index 6a2587d..52b5b04 100644 --- a/epel/init.sls +++ b/epel/init.sls @@ -15,6 +15,7 @@ epel_release: - epel-release: {{ epel.rpm }} - require: - file: install_pubkey_epel + - retry: {{ epel.retry_options | json }} {% if 'repos' in epel %} {% for repo, config in epel.repos.items() %} diff --git a/epel/map.jinja b/epel/map.jinja index 0364f8e..6ba9011 100644 --- a/epel/map.jinja +++ b/epel/map.jinja @@ -2,6 +2,12 @@ 'common': { 'disabled': False, 'testing': False, + 'retry_options': { + 'attempts': 3, + 'until': True, + 'interval': 10, + 'splay': 10, + }, }, 'Amazon': salt['grains.filter_by']({ 2: { diff --git a/pillar.example b/pillar.example index 6f604ed..d8a9afc 100644 --- a/pillar.example +++ b/pillar.example @@ -36,3 +36,10 @@ epel: enabled: false epel-testing-source: enabled: false + + # https://docs.saltproject.io/en/latest/ref/states/requisites.html#retrying-states + retry_options: + attempts: 3 + until: true + interval: 10 + splay: 10