Saltstack Official Nginx Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

33 lines
890B

  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. {%- from tplroot ~ '/service.sls' import service_function with context %}
  8. {% macro file_requisites(states) %}
  9. {%- for state in states %}
  10. - file: {{ state }}
  11. {%- endfor -%}
  12. {% endmacro %}
  13. include:
  14. - nginx.service
  15. - nginx.servers_config
  16. {% if server_states|length() > 0 %}
  17. nginx_service_reload:
  18. service.{{ service_function }}:
  19. - name: {{ nginx.lookup.service }}
  20. - reload: True
  21. - use:
  22. - service: nginx_service
  23. - listen:
  24. {{ file_requisites(server_states) }}
  25. - require:
  26. {{ file_requisites(server_states) }}
  27. - service: nginx_service
  28. {% endif %}