If not enabled in pillar, kill the service.

This commit is contained in:
Adam Bolte 2015-07-13 19:17:26 +10:00
parent eb6b073ad2
commit 672fe36551

View file

@ -1,12 +1,19 @@
haproxy.service:
{% if salt['pillar.get']('haproxy:enable', True) %}
service.running:
- name: haproxy
- enable: True
- reload: True
- require:
- pkg: haproxy
file: haproxy.service
- watch:
- file: haproxy.config
{% else %}
service.dead:
- name: haproxy
- enable: False
{% endif %}
file.replace:
- name: /etc/default/haproxy
{% if salt['pillar.get']('haproxy:enabled', True) %}