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

123456789101112131415161718192021222324252627282930
  1. # nginx.servers
  2. #
  3. # Manages virtual hosts and their relationship to the nginx service.
  4. {%- set tplroot = tpldir.split('/')[0] %}
  5. {%- from tplroot ~ '/map.jinja' import nginx, sls_block with context %}
  6. {%- from tplroot ~ '/servers_config.sls' import server_states with context %}
  7. {% macro file_requisites(states) %}
  8. {%- for state in states %}
  9. - file: {{ state }}
  10. {%- endfor -%}
  11. {% endmacro %}
  12. include:
  13. - nginx.service
  14. - nginx.servers_config
  15. {% if server_states|length() > 0 %}
  16. extend:
  17. nginx_service:
  18. service:
  19. - reload: True
  20. - require:
  21. - file: nginx_config
  22. {{ file_requisites(server_states) }}
  23. - listen:
  24. - file: nginx_config
  25. {{ file_requisites(server_states) }}
  26. {% endif %}