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.

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