2013-08-21 21:01:51 +02:00
|
|
|
/usr/share/nginx:
|
|
|
|
file:
|
|
|
|
- directory
|
|
|
|
|
|
|
|
{% for filename in ('default', 'example_ssl') %}
|
|
|
|
/etc/nginx/conf.d/{{ filename }}.conf:
|
|
|
|
file.absent
|
|
|
|
{% endfor %}
|
|
|
|
|
2014-05-04 20:14:03 +02:00
|
|
|
{% if pillar.get('nginx', {}).get('use_upstart', true) %}
|
2013-08-21 21:01:51 +02:00
|
|
|
{% set logger_types = ('access', 'error') %}
|
|
|
|
|
|
|
|
{% for log_type in logger_types %}
|
|
|
|
/var/log/nginx/{{ log_type }}.log:
|
|
|
|
file.absent
|
|
|
|
|
|
|
|
nginx-logger-{{ log_type }}:
|
|
|
|
file:
|
|
|
|
- managed
|
|
|
|
- name: /etc/init/nginx-logger-{{ log_type }}.conf
|
|
|
|
- template: jinja
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 440
|
2013-09-25 22:53:32 +02:00
|
|
|
- source: salt://nginx/templates/upstart-logger.jinja
|
2013-08-21 21:01:51 +02:00
|
|
|
- context:
|
|
|
|
type: {{ log_type }}
|
|
|
|
service:
|
|
|
|
- running
|
|
|
|
- enable: True
|
|
|
|
- require:
|
|
|
|
- file: nginx-logger-{{ log_type }}
|
|
|
|
- require_in:
|
|
|
|
- service: nginx
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
/etc/logrotate.d/nginx:
|
|
|
|
file:
|
|
|
|
- absent
|
2014-05-04 20:14:03 +02:00
|
|
|
{% endif %}
|
2013-08-21 21:01:51 +02:00
|
|
|
|
|
|
|
/etc/nginx:
|
|
|
|
file.directory:
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
|
|
|
|
/etc/nginx/nginx.conf:
|
|
|
|
file:
|
|
|
|
- managed
|
|
|
|
- template: jinja
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 440
|
|
|
|
- source: salt://nginx/templates/config.jinja
|
|
|
|
- require:
|
|
|
|
- file: /etc/nginx
|
|
|
|
|
|
|
|
{% for dir in ('sites-enabled', 'sites-available') %}
|
|
|
|
/etc/nginx/{{ dir }}:
|
|
|
|
file.directory:
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
{% endfor -%}
|