From 752c3e56414ae84e0d7d63eb9e2c5905154323b4 Mon Sep 17 00:00:00 2001 From: Eric Veiras Galisson Date: Tue, 31 Oct 2017 14:23:53 +0100 Subject: [PATCH] moving specific FreeBSD code to map.jinja, updating pillar.example --- haproxy/config.sls | 3 --- haproxy/map.jinja | 7 +++++-- pillar.example | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/haproxy/config.sls b/haproxy/config.sls index 21cc8fc..71e3d83 100644 --- a/haproxy/config.sls +++ b/haproxy/config.sls @@ -7,9 +7,6 @@ haproxy.config: - source: {{ haproxy.config_file_source }} - template: jinja - user: {{ haproxy.user }} - {% if salt['grains.get']('os_family') == 'FreeBSD' %} - - group: wheel - {% else %} - group: {{ haproxy.group }} {% endif %} - mode: 644 diff --git a/haproxy/map.jinja b/haproxy/map.jinja index ae71ad5..158ef5c 100644 --- a/haproxy/map.jinja +++ b/haproxy/map.jinja @@ -1,5 +1,5 @@ {% set haproxy = salt['grains.filter_by']({ - 'Debian': { + 'default': { 'package': 'haproxy', 'config_file': '/etc/haproxy/haproxy.cfg', 'config_file_source': 'salt://haproxy/templates/haproxy.jinja', @@ -7,5 +7,8 @@ 'group': 'root', 'service': 'haproxy', }, -}, merge=salt['pillar.get']('haproxy:lookup')) %} + 'FreeBSD': { + 'group': 'wheel', + }, +}, merge=salt['pillar.get']('haproxy:lookup'), base='default') %} diff --git a/pillar.example b/pillar.example index ef8fcf9..f49824b 100644 --- a/pillar.example +++ b/pillar.example @@ -3,6 +3,10 @@ # haproxy: + # use lookup section to override 'map.jinja' values + #lookup: + #user: 'custom-user' + #group: 'custom-group' enabled: True overwrite: True # Overwrite an existing config file if present (default behaviour unless set to false) config_file_path: /etc/haproxy/haproxy.cfg