2017-10-31 09:09:52 -04:00
|
|
|
{% from "haproxy/map.jinja" import haproxy with context %}
|
|
|
|
|
|
|
|
{% set config_file = salt['pillar.get']('haproxy:config_file_path', haproxy.config_file) %}
|
2015-02-24 16:19:02 -05:00
|
|
|
haproxy.config:
|
|
|
|
file.managed:
|
2017-10-31 09:09:52 -04:00
|
|
|
- name: {{ config_file }}
|
|
|
|
- source: {{ haproxy.config_file_source }}
|
2015-02-24 16:19:02 -05:00
|
|
|
- template: jinja
|
2017-10-31 09:09:52 -04:00
|
|
|
- user: {{ haproxy.user }}
|
|
|
|
- group: {{ haproxy.group }}
|
2015-02-24 16:19:02 -05:00
|
|
|
- mode: 644
|
2016-01-13 04:41:39 -05:00
|
|
|
- require_in:
|
2015-10-01 18:45:56 -04:00
|
|
|
- service: haproxy.service
|
2016-01-13 04:41:39 -05:00
|
|
|
- watch_in:
|
2016-06-07 15:06:56 -04:00
|
|
|
- service: haproxy.service
|
2016-06-29 05:53:27 -04:00
|
|
|
{% if salt['pillar.get']('haproxy:overwrite', default=True) == False %}
|
|
|
|
- unless:
|
2017-10-31 09:09:52 -04:00
|
|
|
- test -e {{ config_file }}
|
2016-06-29 05:53:27 -04:00
|
|
|
{% endif %}
|