Saltstack Official Nginx Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

26 行
760B

  1. # nginx.snippet
  2. #
  3. # Manages creation of snippets
  4. {%- set tplroot = tpldir.split('/')[0] %}
  5. {%- from tplroot ~ '/map.jinja' import nginx, sls_block with context %}
  6. {%- from tplroot ~ '/libtofs.jinja' import files_switch with context %}
  7. nginx_snippets_dir:
  8. file.directory:
  9. {{ sls_block(nginx.servers.dir_opts) }}
  10. - name: {{ nginx.lookup.snippets_dir }}
  11. {% for snippet, config in nginx.snippets.items() %}
  12. nginx_snippet_{{ snippet }}:
  13. file.managed:
  14. - name: {{ nginx.lookup.snippets_dir ~ '/' ~ snippet }}
  15. - source: {{ files_switch([ snippet, 'server.conf' ],
  16. 'nginx_snippet_file_managed'
  17. )
  18. }}
  19. - template: jinja
  20. - context:
  21. config: {{ config|json() }}
  22. {% endfor %}