2014-10-18 07:33:57 +02:00
|
|
|
{% set nginx = pillar.get('nginx', {}) -%}
|
|
|
|
{% set home = nginx.get('home', '/var/www') -%}
|
|
|
|
{% set conf_dir = nginx.get('conf_dir', '/etc/nginx') -%}
|
|
|
|
{% set conf_template = nginx.get('conf_template', 'salt://nginx/templates/config.jinja') -%}
|
|
|
|
|
|
|
|
{{ home }}:
|
|
|
|
file:
|
|
|
|
- directory
|
|
|
|
- user: www-data
|
|
|
|
- group: www-data
|
|
|
|
- mode: 0755
|
|
|
|
- makedirs: True
|
|
|
|
|
2013-08-21 21:01:51 +02:00
|
|
|
/usr/share/nginx:
|
|
|
|
file:
|
|
|
|
- directory
|
|
|
|
|
|
|
|
{% for filename in ('default', 'example_ssl') %}
|
2014-10-18 07:33:57 +02:00
|
|
|
{{ conf_dir }}/conf.d/{{ filename }}.conf:
|
2013-08-21 21:01:51 +02:00
|
|
|
file.absent
|
|
|
|
{% endfor %}
|
|
|
|
|
2014-10-18 07:33:57 +02:00
|
|
|
{{ conf_dir }}:
|
2013-08-21 21:01:51 +02:00
|
|
|
file.directory:
|
|
|
|
- user: root
|
|
|
|
- group: root
|
2014-10-18 07:33:57 +02:00
|
|
|
- makedirs: True
|
2013-08-21 21:01:51 +02:00
|
|
|
|
2014-10-18 07:33:57 +02:00
|
|
|
{{ conf_dir }}/nginx.conf:
|
2013-08-21 21:01:51 +02:00
|
|
|
file:
|
|
|
|
- managed
|
|
|
|
- template: jinja
|
|
|
|
- user: root
|
|
|
|
- group: root
|
2014-10-18 07:33:57 +02:00
|
|
|
- mode: 644
|
|
|
|
- source: {{ conf_template }}
|
2013-08-21 21:01:51 +02:00
|
|
|
- require:
|
2014-10-18 07:33:57 +02:00
|
|
|
- file: {{ conf_dir }}
|