Skip to content

Commit 92831b6

Browse files
committed
fix(config): ensure haproxy:global:chroot:path is created if provided
1 parent 8c6c855 commit 92831b6

1 file changed

Lines changed: 27 additions & 15 deletions

File tree

haproxy/config.sls

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,30 @@
22
33
{% set config_file = salt['pillar.get']('haproxy:config_file_path', haproxy.config_file) %}
44
haproxy.config:
5-
file.managed:
6-
- name: {{ config_file }}
7-
- source: {{ haproxy.config_file_source }}
8-
- template: jinja
9-
- user: {{ haproxy.user }}
10-
- group: {{ haproxy.group }}
11-
- mode: 644
12-
- require_in:
13-
- service: haproxy.service
14-
- watch_in:
15-
- service: haproxy.service
16-
{% if salt['pillar.get']('haproxy:overwrite', default=True) == False %}
17-
- unless:
18-
- test -e {{ config_file }}
19-
{% endif %}
5+
file.managed:
6+
- name: {{ config_file }}
7+
- source: {{ haproxy.config_file_source }}
8+
- template: jinja
9+
- user: {{ haproxy.user }}
10+
- group: {{ haproxy.group }}
11+
- mode: 644
12+
- require_in:
13+
- service: haproxy.service
14+
- watch_in:
15+
- service: haproxy.service
16+
{% if salt['pillar.get']('haproxy:overwrite', default=True) == False %}
17+
- unless:
18+
- test -e {{ config_file }}
19+
{% endif %}
20+
21+
{% if salt['pillar.get']('haproxy:global:chroot:enable', False) and
22+
salt['pillar.get']('haproxy:global:chroot:path', '') %}
23+
haproxy-chroot-directory:
24+
file.directory:
25+
- name: {{ salt['pillar.get']('haproxy:global:chroot:path') }}
26+
- user: {{ haproxy.user }}
27+
- group: {{ haproxy.group }}
28+
- dir_mode: 755
29+
- require_in:
30+
- service: haproxy.service
31+
{% endif %}

0 commit comments

Comments
 (0)