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