Adjust ENABLED value based on pillar value.

This commit is contained in:
Adam Bolte 2015-07-13 19:14:51 +10:00
parent b4ee8e891d
commit eb6b073ad2
2 changed files with 10 additions and 7 deletions

View File

@ -7,11 +7,13 @@ haproxy.service:
- pkg: haproxy
- watch:
- file: haproxy.config
file.managed:
file.replace:
- name: /etc/default/haproxy
#TODO: Add switch to turn the service on and off based on pillar configuration.
- source: salt://haproxy/files/haproxy-init-enable
- create: True
- user: "root"
- group: "root"
- mode: "0644"
{% if salt['pillar.get']('haproxy:enabled', True) %}
- pattern: ENABLED=0$
- repl: ENABLED=1
{% else %}
- pattern: ENABLED=1$
- repl: ENABLED=0
{% endif %}
- show_changes: True

View File

@ -3,6 +3,7 @@
#
haproxy:
enabled: True
config_file_path: /etc/haproxy/haproxy.cfg
global:
stats: