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

12345678910111213141516171819202122232425262728293031
  1. # nginx.ng.vhosts
  2. #
  3. # Manages virtual hosts and their relationship to the nginx service.
  4. {% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
  5. {% from 'nginx/ng/vhosts_config.sls' import vhost_states with context %}
  6. {% from 'nginx/ng/service.sls' import service_function with context %}
  7. {% macro file_requisites(states) %}
  8. {%- for state in states %}
  9. - file: {{ state }}
  10. {%- endfor -%}
  11. {% endmacro %}
  12. include:
  13. - nginx.ng.service
  14. - nginx.ng.vhosts_config
  15. {% if vhost_states|length() > 0 %}
  16. nginx_service_reload:
  17. service.{{ service_function }}:
  18. - name: {{ nginx.lookup.service }}
  19. - reload: True
  20. - use:
  21. - service: nginx_service
  22. - watch:
  23. {{ file_requisites(vhost_states) }}
  24. - require:
  25. {{ file_requisites(vhost_states) }}
  26. - service: nginx_service
  27. {% endif %}