Saltstack Official Nginx Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

passenger.sls 1.3KB

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