moving specific FreeBSD code to map.jinja, updating pillar.example

This commit is contained in:
Eric Veiras Galisson 2017-10-31 14:23:53 +01:00
parent 2b83ca0860
commit 752c3e5641
3 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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') %}

View File

@ -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