2014-05-27 20:55:49 -03:00
|
|
|
# nginx.ng.config
|
2014-05-19 13:22:51 -04:00
|
|
|
#
|
|
|
|
# Manages the main nginx server configuration file.
|
|
|
|
|
2014-05-15 18:06:48 -04:00
|
|
|
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
|
|
|
|
|
2016-05-09 17:59:55 +01:00
|
|
|
{% if nginx.install_from_source %}
|
2016-05-10 12:06:42 +01:00
|
|
|
nginx_log_dir:
|
2016-05-10 12:00:18 +01:00
|
|
|
file.directory:
|
|
|
|
- name: /var/log/nginx
|
2016-05-10 12:06:42 +01:00
|
|
|
- user: {{ nginx.server.config.user }}
|
|
|
|
- group: {{ nginx.server.config.user }}
|
2016-05-09 17:59:55 +01:00
|
|
|
{% endif %}
|
|
|
|
|
2014-05-15 18:06:48 -04:00
|
|
|
nginx_config:
|
|
|
|
file.managed:
|
|
|
|
{{ sls_block(nginx.server.opts) }}
|
|
|
|
- name: {{ nginx.lookup.conf_file }}
|
|
|
|
- source: salt://nginx/ng/files/nginx.conf
|
|
|
|
- template: jinja
|
|
|
|
- context:
|
2014-05-21 15:13:13 -04:00
|
|
|
config: {{ nginx.server.config|json() }}
|