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.

passenger.sls 1.2KB

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