|
|
|
|
|
|
|
|
{% 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 |
|
|
|
|
|
|
|
|
- use: |
|
|
- use: |
|
|
- service: nginx_service |
|
|
- service: nginx_service |
|
|
- watch: |
|
|
- watch: |
|
|
{%- for vhost in vhost_states %} |
|
|
|
|
|
- file: {{ vhost }} |
|
|
|
|
|
{% endfor -%} |
|
|
|
|
|
|
|
|
{{ file_requisites(vhost_states) }} |
|
|
|
|
|
- require: |
|
|
|
|
|
{{ file_requisites(vhost_states) }} |
|
|
|
|
|
- service: nginx_service |
|
|
{% endif %} |
|
|
{% endif %} |