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.

30 lines
812B

  1. # nginx.ng.config
  2. #
  3. # Manages the main nginx server configuration file.
  4. {% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
  5. {% if nginx.install_from_source %}
  6. nginx_log_dir:
  7. file.directory:
  8. - name: /var/log/nginx
  9. - user: {{ nginx.server.config.user }}
  10. - group: {{ nginx.server.config.user }}
  11. {% endif %}
  12. {% if 'source_path' in nginx.server.config %}
  13. {% set source_path = nginx.server.config.source_path %}
  14. {% else %}
  15. {% set source_path = 'salt://nginx/ng/files/nginx.conf' %}
  16. {% endif %}
  17. nginx_config:
  18. file.managed:
  19. {{ sls_block(nginx.server.opts) }}
  20. - name: {{ nginx.lookup.conf_file }}
  21. - source: {{ source_path }}
  22. - template: jinja
  23. {% if 'source_path' not in nginx.server.config %}
  24. - context:
  25. config: {{ nginx.server.config|json() }}
  26. {% endif %}