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.

56 satır
1.4KB

  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. - nginx.servers
  17. - nginx.certificates
  18. passenger_install:
  19. pkg.installed:
  20. {{ sls_block(nginx.package.opts) }}
  21. - name: {{ nginx.lookup.passenger_package }}
  22. - require:
  23. - pkg: nginx_install
  24. - require_in:
  25. - service: nginx_service
  26. - file: nginx_config
  27. /etc/nginx/passenger.conf:
  28. file.absent:
  29. - require:
  30. - pkg: passenger_install
  31. passenger_config:
  32. file.managed:
  33. {{ sls_block(nginx.server.opts) }}
  34. - name: {{ nginx.lookup.passenger_config_file }}
  35. - source: {{ files_switch(['nginx.conf'],
  36. 'passenger_config_file_managed'
  37. )
  38. }}
  39. - template: jinja
  40. - context:
  41. config: {{ nginx.passenger|json() }}
  42. - watch_in:
  43. - service: nginx_service
  44. - require_in:
  45. - service: nginx_service
  46. - file: nginx_config
  47. - require:
  48. - file: /etc/nginx/passenger.conf
  49. - pkg: passenger_install
  50. {% endif %}