If not enabled in pillar, kill the service.
This commit is contained in:
parent
eb6b073ad2
commit
672fe36551
1 changed files with 7 additions and 0 deletions
|
@ -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) %}
|
||||||
|
|
Loading…
Reference in a new issue