From 81fe75f2992a7c170bf828d84c7fb0da33e339fc Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Fri, 26 Aug 2022 17:58:25 +0900 Subject: [PATCH] feat(reload/enable): add options for services --- pillar.example | 4 ++++ prometheus/service/running.sls | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pillar.example b/pillar.example index b193b3fc..441a51a9 100644 --- a/pillar.example +++ b/pillar.example @@ -126,6 +126,10 @@ prometheus: service: args: web.listen-address: 0.0.0.0:9090 + # Enable the service on startup (default: true) + enable: true + # Reload service if changes occur instead of restarting (default: false) + reload: false config: # yamllint disable-line rule:line-length # ref https://raw.githubusercontent.com/prometheus/prometheus/release-2.10/config/testdata/conf.good.yml diff --git a/prometheus/service/running.sls b/prometheus/service/running.sls index 62bb86be..026beaba 100644 --- a/prometheus/service/running.sls +++ b/prometheus/service/running.sls @@ -33,7 +33,8 @@ prometheus-service-running-{{ name }}-unmasked: prometheus-service-running-{{ name }}: service.running: - - enable: True + - enable: {{ p.pkg.component[name]['service'].get('enable', True) }} + - reload: {{ p.pkg.component[name]['service'].get('reload', False) }} - require: - sls: {{ sls_config_file }} {%- if grains.kernel|lower == 'linux' %}