nginx-formula/nginx/ng/service.sls
George Robinson f24b066c43 Build from source with nginx.ng
Build NGINX from source with nginx.ng state with support for passing
compile time flags necessary for installing modules such as more headers
by the openresty project.
2016-05-09 16:39:24 +01:00

30 lines
747 B
Plaintext

# nginx.ng.service
#
# Manages the nginx service.
{% 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
{% if nginx.install_from_source %}
/lib/systemd/system/nginx.service:
file.managed:
- source: salt://nginx/ng/files/nginx.service
{% endif %}
nginx_service:
service.{{ service_function }}:
{{ sls_block(nginx.service.opts) }}
- name: {{ nginx.lookup.service }}
- enable: {{ nginx.service.enable }}
- require:
- sls: nginx.ng.install
- watch:
{% if nginx.install_from_source %}
- cmd: nginx_install
{% else %}
- pkg: nginx_install
{% endif %}