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.

пре 10 година
пре 10 година
пре 10 година
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 %}