From 080bff7b3dc43a8720c6c5f8a493a1ca3d13de33 Mon Sep 17 00:00:00 2001 From: N Date: Mon, 15 Apr 2019 00:26:32 +0100 Subject: [PATCH 1/2] Always retry alternatives.install state --- postgres/client/init.sls | 3 +++ postgres/dev/init.sls | 3 +++ postgres/server/init.sls | 3 +++ 3 files changed, 9 insertions(+) diff --git a/postgres/client/init.sls b/postgres/client/init.sls index 6724637..041c105 100644 --- a/postgres/client/init.sls +++ b/postgres/client/init.sls @@ -39,6 +39,9 @@ postgresql-{{ bin }}-altinstall: - onlyif: test -f {{ path }} - require: - pkg: postgresql-client-libs + - retry: + attempts: 2 + until: True {%- endfor %} {%- endif %} diff --git a/postgres/dev/init.sls b/postgres/dev/init.sls index 09b4323..2085406 100644 --- a/postgres/dev/init.sls +++ b/postgres/dev/init.sls @@ -27,6 +27,9 @@ postgresql-{{ bin }}-altinstall: - onlyif: alternatives --display {{ bin }} {% else %} - onlyif: test -f {{ path }} + - retry: + attempts: 2 + until: True {% endif %} {%- endfor %} diff --git a/postgres/server/init.sls b/postgres/server/init.sls index d9a5409..2ef98dd 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -54,6 +54,9 @@ postgresql-{{ bin }}-altinstall: - pkg: postgresql-server - require_in: - cmd: postgresql-cluster-prepared + - retry: + attempts: 2 + until: True {%- endfor %} {%- endif %} From f3d88301773f7cafba2c24d0b3b6e4662f81d975 Mon Sep 17 00:00:00 2001 From: N Date: Mon, 15 Apr 2019 12:58:00 +0100 Subject: [PATCH 2/2] Implement review comment (conditional) --- postgres/client/init.sls | 2 ++ postgres/dev/init.sls | 6 ++---- postgres/server/init.sls | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/postgres/client/init.sls b/postgres/client/init.sls index 041c105..839eecd 100644 --- a/postgres/client/init.sls +++ b/postgres/client/init.sls @@ -39,9 +39,11 @@ postgresql-{{ bin }}-altinstall: - onlyif: test -f {{ path }} - require: - pkg: postgresql-client-libs + {%- if grains['saltversioninfo'] < [2018, 11, 0, 0] %} - retry: attempts: 2 until: True + {%- endif %} {%- endfor %} {%- endif %} diff --git a/postgres/dev/init.sls b/postgres/dev/init.sls index 2085406..b3e07b9 100644 --- a/postgres/dev/init.sls +++ b/postgres/dev/init.sls @@ -23,14 +23,12 @@ postgresql-{{ bin }}-altinstall: - link: {{ salt['file.join']('/usr/bin', bin) }} - path: {{ path }} - priority: {{ postgres.linux.altpriority }} - {% if grains.os in ('Fedora', 'CentOS',) %} {# bypass bug #} - - onlyif: alternatives --display {{ bin }} - {% else %} - onlyif: test -f {{ path }} + {%- if grains['saltversioninfo'] < [2018, 11, 0, 0] %} - retry: attempts: 2 until: True - {% endif %} + {%- endif %} {%- endfor %} {%- endif %} diff --git a/postgres/server/init.sls b/postgres/server/init.sls index 2ef98dd..cb3cdc3 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -54,9 +54,11 @@ postgresql-{{ bin }}-altinstall: - pkg: postgresql-server - require_in: - cmd: postgresql-cluster-prepared + {%- if grains['saltversioninfo'] < [2018, 11, 0, 0] %} - retry: attempts: 2 until: True + {%- endif %} {%- endfor %} {%- endif %}