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.

1234567891011121314151617181920212223242526272829303132
  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 %}