2014-05-16 00:06:48 +02:00
|
|
|
# nginx.ng.service
|
|
|
|
#
|
|
|
|
# Manages the nginx service.
|
2014-05-19 19:22:51 +02:00
|
|
|
|
2014-05-16 00:06:48 +02:00
|
|
|
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
|
|
|
|
{% set service_function = {True:'running', False:'dead'}.get(nginx.service.enable) %}
|
|
|
|
|
|
|
|
include:
|
|
|
|
- nginx.ng.install
|
|
|
|
|
|
|
|
nginx_service:
|
|
|
|
service.{{ service_function }}:
|
|
|
|
{{ sls_block(nginx.service.opts) }}
|
|
|
|
- name: {{ nginx.lookup.service }}
|
|
|
|
- enable: {{ nginx.service.enable }}
|
|
|
|
- require:
|
|
|
|
- sls: nginx.ng.install
|
|
|
|
- watch:
|
2014-08-12 04:01:38 +02:00
|
|
|
{% if not nginx.install_from_source %}
|
2014-05-16 00:06:48 +02:00
|
|
|
- pkg: nginx_install
|
|
|
|
{% endif %}
|