nginx-formula/nginx/snippets.sls
Eric Veiras Galisson 0fc507055d refactor: replace old nginx with nginx.ng
BREAKING CHANGE: all previous `nginx` based configurations must be reviewed;
`nginx.ng` usage must be promoted to `nginx` and any uses of the original
`nginx` will have to be converted.
2019-05-12 17:13:17 +01:00

21 lines
535 B
Plaintext

# nginx.snippet
#
# Manages creation of snippets
{% from 'nginx/map.jinja' import nginx, sls_block with context %}
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
- source: salt://nginx/files/server.conf
- template: jinja
- context:
config: {{ config|json() }}
{% endfor %}