Saltstack Official Nginx Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
535B

  1. # nginx.snippet
  2. #
  3. # Manages creation of snippets
  4. {% from 'nginx/map.jinja' import nginx, sls_block with context %}
  5. nginx_snippets_dir:
  6. file.directory:
  7. {{ sls_block(nginx.servers.dir_opts) }}
  8. - name: {{ nginx.lookup.snippets_dir }}
  9. {% for snippet, config in nginx.snippets.items() %}
  10. nginx_snippet_{{ snippet }}:
  11. file.managed:
  12. - name: {{ nginx.lookup.snippets_dir }}/{{ snippet }}.conf
  13. - source: salt://nginx/files/server.conf
  14. - template: jinja
  15. - context:
  16. config: {{ config|json() }}
  17. {% endfor %}