From 6dd8d7840d8ed627507fc6f2eb501dc6ec76c682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20CAMPO?= Date: Tue, 21 May 2024 11:45:37 +0200 Subject: [PATCH] feat(files): new option to clean residual conf files in services.d folder --- pillar.example | 6 ++++++ stunnel/defaults.yaml | 1 + stunnel/init.sls | 3 +++ 3 files changed, 10 insertions(+) diff --git a/pillar.example b/pillar.example index ecdb512..20fe80b 100644 --- a/pillar.example +++ b/pillar.example @@ -14,6 +14,12 @@ stunnel: log_dir: /var/log/stunnel pid: /var/run/stunnel.pid debug: notice + # Setting this to true will make it so that everytime you run + # the formula, it will start by making sure that there is no + # residual configuration file. However, by doing so, you will + # also remove any manual configuration you set outside of using + # salt + clean_services_dir: false # Set certificates_auto_config to false if you do not want to use # the automated certificates configuration from this formula. # Also, this will unset verifyChain and verifyPeer. diff --git a/stunnel/defaults.yaml b/stunnel/defaults.yaml index f027666..8778ed4 100644 --- a/stunnel/defaults.yaml +++ b/stunnel/defaults.yaml @@ -9,3 +9,4 @@ stunnel: root_user: root root_group: root + clean_services_dir: false diff --git a/stunnel/init.sls b/stunnel/init.sls index 6a04101..1a12164 100644 --- a/stunnel/init.sls +++ b/stunnel/init.sls @@ -27,6 +27,9 @@ stunnel_package: - user: {{ stunnel.root_user }} - group: {{ stunnel.group }} - mode: 750 +{%- if stunnel.clean_services_dir %} + - clean: True +{%- endif %} {{ stunnel.conf_dir }}/tls: file.directory: