formula-haproxy/haproxy/config.sls
Eric Veiras Galisson 2b83ca0860 refactoring code to use map.jinja for config values
at the moment only Debian managed, FreeBSD exception still in state
2017-10-31 14:41:54 +01:00

24 lines
692 B
Plaintext

{% from "haproxy/map.jinja" import haproxy with context %}
{% set config_file = salt['pillar.get']('haproxy:config_file_path', haproxy.config_file) %}
haproxy.config:
file.managed:
- name: {{ config_file }}
- 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
- require_in:
- service: haproxy.service
- watch_in:
- service: haproxy.service
{% if salt['pillar.get']('haproxy:overwrite', default=True) == False %}
- unless:
- test -e {{ config_file }}
{% endif %}