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: haproxy.service:
{% if salt['pillar.get']('haproxy:enable', True) %}
service.running: service.running:
- name: haproxy - name: haproxy
- enable: True - enable: True
- reload: True - reload: True
- require: - require:
- pkg: haproxy - pkg: haproxy
file: haproxy.service
- watch: - watch:
- file: haproxy.config - file: haproxy.config
{% else %}
service.dead:
- name: haproxy
- enable: False
{% endif %}
file.replace: file.replace:
- name: /etc/default/haproxy - name: /etc/default/haproxy
{% if salt['pillar.get']('haproxy:enabled', True) %} {% if salt['pillar.get']('haproxy:enabled', True) %}