Tightened up some requirements.

This commit is contained in:
Chad Heuschober 2014-05-21 00:50:50 -04:00
parent 3b89181478
commit 9f8dc59973
2 changed files with 12 additions and 3 deletions

View File

@ -12,3 +12,5 @@ extend:
service: service:
- watch: - watch:
- file: nginx_config - file: nginx_config
- require:
- file: nginx_config

View File

@ -6,6 +6,12 @@
{% from 'nginx/ng/vhosts_config.sls' import vhost_states with context %} {% from 'nginx/ng/vhosts_config.sls' import vhost_states with context %}
{% from 'nginx/ng/service.sls' import service_function 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: include:
- nginx.ng.service - nginx.ng.service
- nginx.ng.vhosts_config - nginx.ng.vhosts_config
@ -18,7 +24,8 @@ nginx_service_reload:
- use: - use:
- service: nginx_service - service: nginx_service
- watch: - watch:
{%- for vhost in vhost_states %} {{ file_requisites(vhost_states) }}
- file: {{ vhost }} - require:
{% endfor -%} {{ file_requisites(vhost_states) }}
- service: nginx_service
{% endif %} {% endif %}