2014-10-08 19:17:06 +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
|
|
|
|
- source: salt://nginx/templates/upstart-logger.jinja
|
|
|
|
- context:
|
2019-04-11 15:02:18 +02:00
|
|
|
type: {{ log_type }}
|
2014-10-08 19:17:06 +02:00
|
|
|
service:
|
|
|
|
- running
|
|
|
|
- enable: True
|
|
|
|
- require:
|
|
|
|
- file: nginx-logger-{{ log_type }}
|
|
|
|
- require_in:
|
|
|
|
- service: nginx
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
/etc/logrotate.d/nginx:
|
|
|
|
file.absent
|