Skip to content

Commit 752c3e5

Browse files
committed
moving specific FreeBSD code to map.jinja, updating pillar.example
1 parent 2b83ca0 commit 752c3e5

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

haproxy/config.sls

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ haproxy.config:
77
- source: {{ haproxy.config_file_source }}
88
- template: jinja
99
- user: {{ haproxy.user }}
10-
{% if salt['grains.get']('os_family') == 'FreeBSD' %}
11-
- group: wheel
12-
{% else %}
1310
- group: {{ haproxy.group }}
1411
{% endif %}
1512
- mode: 644

haproxy/map.jinja

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{% set haproxy = salt['grains.filter_by']({
2-
'Debian': {
2+
'default': {
33
'package': 'haproxy',
44
'config_file': '/etc/haproxy/haproxy.cfg',
55
'config_file_source': 'salt://haproxy/templates/haproxy.jinja',
66
'user': 'root',
77
'group': 'root',
88
'service': 'haproxy',
99
},
10-
}, merge=salt['pillar.get']('haproxy:lookup')) %}
10+
'FreeBSD': {
11+
'group': 'wheel',
12+
},
13+
}, merge=salt['pillar.get']('haproxy:lookup'), base='default') %}
1114

pillar.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#
44

55
haproxy:
6+
# use lookup section to override 'map.jinja' values
7+
#lookup:
8+
#user: 'custom-user'
9+
#group: 'custom-group'
610
enabled: True
711
overwrite: True # Overwrite an existing config file if present (default behaviour unless set to false)
812
config_file_path: /etc/haproxy/haproxy.cfg

0 commit comments

Comments
 (0)