From 118f5cf3da6659999aa1e6239614759ed47d9813 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Thu, 14 Mar 2024 02:39:01 +0100 Subject: [PATCH] feat(suse): skip directory management On SUSE based distributions the chroot/data directory is managed by the distribution package. Skip superfluous management and permission overwriting through the formula states. Signed-off-by: Georg Pfuetzenreuter --- haproxy/config.sls | 3 ++- haproxy/map.jinja | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/haproxy/config.sls b/haproxy/config.sls index 9c2d528..53a526d 100644 --- a/haproxy/config.sls +++ b/haproxy/config.sls @@ -18,7 +18,8 @@ haproxy.config: - test -e {{ config_file }} {% endif %} -{% if salt['pillar.get']('haproxy:global:chroot:enable', False) and +{% if haproxy.manage_directories and + salt['pillar.get']('haproxy:global:chroot:enable', False) and salt['pillar.get']('haproxy:global:chroot:path', '') %} haproxy-chroot-directory: file.directory: diff --git a/haproxy/map.jinja b/haproxy/map.jinja index 801e891..c17bd04 100644 --- a/haproxy/map.jinja +++ b/haproxy/map.jinja @@ -6,10 +6,14 @@ 'user': 'root', 'group': 'root', 'service': 'haproxy', + 'manage_directories': True, }, 'FreeBSD': { 'config_file': '/usr/local/etc/haproxy.conf', 'group': 'wheel', }, + 'Suse': { + 'manage_directories': False, + }, }, merge=salt['pillar.get']('haproxy:lookup'), base='default') %}