From 698b7eae59e1585483fa26366f38bed12a835843 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 23 Apr 2021 09:13:59 +0100 Subject: [PATCH] fix(freebsd): use `retry_options` to avoid spurious service failures Use the `retry_options` already being used for the Salt minion service, since we're getting failures such as this one: * https://github.com/myii/salt-formula/runs/2415072504 This is made worse by the fact that GitHub Actions cannot re-run a single job (at the current time). --- salt/api.sls | 3 +++ salt/master.sls | 3 +++ salt/standalone.sls | 3 +++ salt/syndic.sls | 3 +++ 4 files changed, 12 insertions(+) diff --git a/salt/api.sls b/salt/api.sls index da2b84c..bd85fb7 100644 --- a/salt/api.sls +++ b/salt/api.sls @@ -15,6 +15,9 @@ salt-api: service.{{ salt_settings.api_service_details.state }}: - enable: {{ salt_settings.api_service_details.enabled }} - name: {{ salt_settings.api_service }} + {%- if grains.os_family == 'FreeBSD' %} + - retry: {{ salt_settings.retry_options | json }} + {%- endif %} - require: - service: {{ salt_settings.master_service }} - watch: diff --git a/salt/master.sls b/salt/master.sls index 13cc5a8..9d08d05 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -52,6 +52,9 @@ salt-master: service.{{ salt_settings.master_service_details.state }}: - enable: {{ salt_settings.master_service_details.enabled }} - name: {{ salt_settings.master_service }} + {%- if grains.os_family == 'FreeBSD' %} + - retry: {{ salt_settings.retry_options | json }} + {%- endif %} - watch: {%- if grains.kernel|lower == 'darwin' %} - file: salt-master-macos diff --git a/salt/standalone.sls b/salt/standalone.sls index 8829d2c..a14f12b 100644 --- a/salt/standalone.sls +++ b/salt/standalone.sls @@ -25,6 +25,9 @@ salt-minion-standalone: - enable: False {%- endif %} - name: {{ salt_settings.minion_service }} + {%- if grains.os_family == 'FreeBSD' %} + - retry: {{ salt_settings.retry_options | json }} + {%- endif %} - require: {% if salt_settings.install_packages %} - pkg: salt-minion-standalone diff --git a/salt/syndic.sls b/salt/syndic.sls index 069ae7c..d6d6875 100644 --- a/salt/syndic.sls +++ b/salt/syndic.sls @@ -18,6 +18,9 @@ salt-syndic: service.running: - enable: True - name: {{ salt_settings.syndic_service }} + {%- if grains.os_family == 'FreeBSD' %} + - retry: {{ salt_settings.retry_options | json }} + {%- endif %} - require: - service: salt-master - watch: