-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathconfig.sls
More file actions
32 lines (30 loc) · 1.01 KB
/
config.sls
File metadata and controls
32 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{% from tpldir ~ "/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 }}
- group: {{ haproxy.group }}
- 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 %}
{% if haproxy.manage_directories and
salt['pillar.get']('haproxy:global:chroot:enable', False) and
salt['pillar.get']('haproxy:global:chroot:path', '') %}
haproxy-chroot-directory:
file.directory:
- name: {{ salt['pillar.get']('haproxy:global:chroot:path') }}
- user: {{ haproxy.user }}
- group: {{ haproxy.group }}
- dir_mode: 755
- require_in:
- service: haproxy.service
{% endif %}