2019-05-10 23:07:18 +02:00
|
|
|
# nginx.passenger
|
2017-06-24 15:43:25 +02:00
|
|
|
#
|
|
|
|
# Manages installation of passenger from repo.
|
|
|
|
# Requires install_from_phusionpassenger = True
|
|
|
|
|
2019-05-10 23:07:18 +02:00
|
|
|
{% from 'nginx/map.jinja' import nginx, sls_block with context %}
|
2017-06-24 15:43:25 +02:00
|
|
|
|
|
|
|
{% if salt['grains.get']('os_family') in ['Debian', 'RedHat'] %}
|
|
|
|
include:
|
2019-05-10 23:07:18 +02:00
|
|
|
- nginx.pkg
|
|
|
|
- nginx.service
|
2017-06-24 15:43:25 +02:00
|
|
|
|
|
|
|
passenger_install:
|
|
|
|
pkg.installed:
|
|
|
|
- name: {{ nginx.lookup.passenger_package }}
|
|
|
|
- require:
|
|
|
|
- pkg: nginx_install
|
|
|
|
- require_in:
|
|
|
|
- service: nginx_service
|
|
|
|
|
|
|
|
/etc/nginx/passenger.conf:
|
|
|
|
file.absent:
|
|
|
|
- require:
|
|
|
|
- pkg: passenger_install
|
|
|
|
|
|
|
|
passenger_config:
|
|
|
|
file.managed:
|
|
|
|
{{ sls_block(nginx.server.opts) }}
|
2018-02-14 01:27:15 +01:00
|
|
|
- name: {{ nginx.lookup.passenger_config_file }}
|
2019-05-10 23:07:18 +02:00
|
|
|
- source: salt://nginx/files/nginx.conf
|
2017-06-24 15:43:25 +02:00
|
|
|
- template: jinja
|
|
|
|
- context:
|
2019-04-11 15:02:18 +02:00
|
|
|
config: {{ nginx.passenger|json() }}
|
2017-06-24 15:43:25 +02:00
|
|
|
- watch_in:
|
|
|
|
- service: nginx_service
|
|
|
|
- require_in:
|
|
|
|
- service: nginx_service
|
|
|
|
- require:
|
|
|
|
- file: /etc/nginx/passenger.conf
|
|
|
|
- pkg: passenger_install
|
|
|
|
{% endif %}
|