Skip to content

Commit b69c7ed

Browse files
authored
Merge pull request #56 from grobinson-blockchain/master
Support optional overwrite of existing configuration files
2 parents dfd7468 + 4e5f763 commit b69c7ed

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

haproxy/config.sls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ haproxy.config:
1414
- service: haproxy.service
1515
- watch_in:
1616
- service: haproxy.service
17+
{% if salt['pillar.get']('haproxy:overwrite', default=True) == False %}
18+
- unless:
19+
- test -e {{ salt['pillar.get']('haproxy:config_file_path', '/etc/haproxy/haproxy.cfg') }}
20+
{% endif %}

pillar.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
haproxy:
66
enabled: True
7+
overwrite: True # Overwrite an existing config file if present (default behaviour unless set to false)
78
config_file_path: /etc/haproxy/haproxy.cfg
89
global:
910
stats:

0 commit comments

Comments
 (0)