From 672fe36551de625cd0339bab71371946b586b800 Mon Sep 17 00:00:00 2001 From: Adam Bolte Date: Mon, 13 Jul 2015 19:17:26 +1000 Subject: [PATCH] If not enabled in pillar, kill the service. --- haproxy/service.sls | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/haproxy/service.sls b/haproxy/service.sls index 4b36610..62d4193 100644 --- a/haproxy/service.sls +++ b/haproxy/service.sls @@ -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) %}