Saltstack Official Nginx Formula
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

47 lines
1.2KB

  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 %}