From 9f8dc5997392c4341fb400b04586c8eb8e16872b Mon Sep 17 00:00:00 2001 From: Chad Heuschober Date: Wed, 21 May 2014 00:50:50 -0400 Subject: [PATCH] Tightened up some requirements. --- nginx/ng/init.sls | 2 ++ nginx/ng/vhosts.sls | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/nginx/ng/init.sls b/nginx/ng/init.sls index 4cf4ecf..c48142a 100644 --- a/nginx/ng/init.sls +++ b/nginx/ng/init.sls @@ -12,3 +12,5 @@ extend: service: - watch: - file: nginx_config + - require: + - file: nginx_config diff --git a/nginx/ng/vhosts.sls b/nginx/ng/vhosts.sls index bfe67b1..c9ec514 100644 --- a/nginx/ng/vhosts.sls +++ b/nginx/ng/vhosts.sls @@ -6,6 +6,12 @@ {% from 'nginx/ng/vhosts_config.sls' import vhost_states with context %} {% from 'nginx/ng/service.sls' import service_function with context %} +{% macro file_requisites(states) %} + {%- for state in states %} + - file: {{ state }} + {%- endfor -%} +{% endmacro %} + include: - nginx.ng.service - nginx.ng.vhosts_config @@ -18,7 +24,8 @@ nginx_service_reload: - use: - service: nginx_service - watch: - {%- for vhost in vhost_states %} - - file: {{ vhost }} - {% endfor -%} + {{ file_requisites(vhost_states) }} + - require: + {{ file_requisites(vhost_states) }} + - service: nginx_service {% endif %}