05994e1b17
* servers_config should run without service dependency. Service is managed in servers.sls. * dropped nginx_service_reload in favor of extending nginx_service * wait for all file states (create and delete) * create dirs for symlinked files
29 lines
686 B
Plaintext
29 lines
686 B
Plaintext
# nginx.servers
|
|
#
|
|
# Manages virtual hosts and their relationship to the nginx service.
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
{%- from tplroot ~ '/map.jinja' import nginx, sls_block with context %}
|
|
{%- from tplroot ~ '/servers_config.sls' import server_states with context %}
|
|
|
|
{% macro file_requisites(states) %}
|
|
{%- for state in states %}
|
|
- file: {{ state }}
|
|
{%- endfor -%}
|
|
{% endmacro %}
|
|
|
|
include:
|
|
- nginx.service
|
|
- nginx.servers_config
|
|
|
|
{% if server_states|length() > 0 %}
|
|
extend:
|
|
nginx_service:
|
|
service:
|
|
- reload: True
|
|
- require:
|
|
{{ file_requisites(server_states) }}
|
|
- listen:
|
|
{{ file_requisites(server_states) }}
|
|
{% endif %}
|