Adjust ENABLED value based on pillar value.
This commit is contained in:
parent
b4ee8e891d
commit
eb6b073ad2
2 changed files with 10 additions and 7 deletions
|
@ -7,11 +7,13 @@ haproxy.service:
|
||||||
- pkg: haproxy
|
- pkg: haproxy
|
||||||
- watch:
|
- watch:
|
||||||
- file: haproxy.config
|
- file: haproxy.config
|
||||||
file.managed:
|
file.replace:
|
||||||
- name: /etc/default/haproxy
|
- name: /etc/default/haproxy
|
||||||
#TODO: Add switch to turn the service on and off based on pillar configuration.
|
{% if salt['pillar.get']('haproxy:enabled', True) %}
|
||||||
- source: salt://haproxy/files/haproxy-init-enable
|
- pattern: ENABLED=0$
|
||||||
- create: True
|
- repl: ENABLED=1
|
||||||
- user: "root"
|
{% else %}
|
||||||
- group: "root"
|
- pattern: ENABLED=1$
|
||||||
- mode: "0644"
|
- repl: ENABLED=0
|
||||||
|
{% endif %}
|
||||||
|
- show_changes: True
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
haproxy:
|
haproxy:
|
||||||
|
enabled: True
|
||||||
config_file_path: /etc/haproxy/haproxy.cfg
|
config_file_path: /etc/haproxy/haproxy.cfg
|
||||||
global:
|
global:
|
||||||
stats:
|
stats:
|
||||||
|
|
Loading…
Reference in a new issue