Saltstack Official Nginx Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

59 rindas
1.5KB

  1. # nginx.passenger
  2. #
  3. # Manages installation of passenger from repo.
  4. # Requires install_from_phusionpassenger = True
  5. {%- set tplroot = tpldir.split('/')[0] %}
  6. {%- from tplroot ~ '/map.jinja' import nginx, sls_block with context %}
  7. {%- from tplroot ~ '/libtofs.jinja' import files_switch with context %}
  8. {% if salt['grains.get']('os_family') in ['Debian', 'RedHat'] %}
  9. include:
  10. - nginx.pkg
  11. - nginx.config
  12. - nginx.service
  13. {%- if nginx.snippets is defined %}
  14. - nginx.snippets
  15. {%- endif %}
  16. {%- if nginx.streams is defined %}
  17. - nginx.streams
  18. {%- endif %}
  19. - nginx.servers
  20. - nginx.certificates
  21. passenger_install:
  22. pkg.installed:
  23. {{ sls_block(nginx.package.opts) }}
  24. - name: {{ nginx.lookup.passenger_package }}
  25. - require:
  26. - pkg: nginx_install
  27. - require_in:
  28. - service: nginx_service
  29. - file: nginx_config
  30. /etc/nginx/passenger.conf:
  31. file.absent:
  32. - require:
  33. - pkg: passenger_install
  34. passenger_config:
  35. file.managed:
  36. {{ sls_block(nginx.server.opts) }}
  37. - name: {{ nginx.lookup.passenger_config_file }}
  38. - source: {{ files_switch(['nginx.conf'],
  39. 'passenger_config_file_managed'
  40. )
  41. }}
  42. - template: jinja
  43. - context:
  44. config: {{ nginx.passenger|json() }}
  45. - watch_in:
  46. - service: nginx_service
  47. - require_in:
  48. - service: nginx_service
  49. - file: nginx_config
  50. - require:
  51. - file: /etc/nginx/passenger.conf
  52. - pkg: passenger_install
  53. {% endif %}