2019-05-10 23:07:18 +02:00
|
|
|
# nginx.snippet
|
2017-08-30 00:26:31 +02:00
|
|
|
#
|
|
|
|
# Manages creation of snippets
|
|
|
|
|
2019-05-10 23:07:18 +02:00
|
|
|
{% from 'nginx/map.jinja' import nginx, sls_block with context %}
|
2017-08-30 00:26:31 +02:00
|
|
|
|
|
|
|
nginx_snippets_dir:
|
|
|
|
file.directory:
|
|
|
|
{{ sls_block(nginx.servers.dir_opts) }}
|
|
|
|
- name: {{ nginx.lookup.snippets_dir }}
|
|
|
|
|
|
|
|
{% for snippet, config in nginx.snippets.items() %}
|
|
|
|
nginx_snippet_{{ snippet }}:
|
|
|
|
file.managed:
|
|
|
|
- name: {{ nginx.lookup.snippets_dir }}/{{ snippet }}.conf
|
2019-05-10 23:07:18 +02:00
|
|
|
- source: salt://nginx/files/server.conf
|
2017-08-30 00:26:31 +02:00
|
|
|
- template: jinja
|
|
|
|
- context:
|
|
|
|
config: {{ config|json() }}
|
|
|
|
{% endfor %}
|