Saltstack Official Nginx Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031
  1. {% set logger_types = ('access', 'error') %}
  2. {% for log_type in logger_types %}
  3. /var/log/nginx/{{ log_type }}.log:
  4. file.absent
  5. nginx-logger-{{ log_type }}:
  6. file:
  7. - managed
  8. - name: /etc/init.d/nginx-logger-{{ log_type }}
  9. - template: jinja
  10. - user: root
  11. - group: root
  12. - mode: 755
  13. - source: salt://nginx/templates/sysvinit-logger.jinja
  14. - context:
  15. type: {{ log_type }}
  16. service:
  17. - running
  18. - enable: True
  19. - require:
  20. - file: nginx-logger-{{ log_type }}
  21. - require_in:
  22. - service: nginx
  23. cmd:
  24. - wait
  25. - name: /usr/sbin/update-rc.d nginx-logger-{{ log_type }} defaults
  26. {% endfor %}
  27. /etc/logrotate.d/nginx:
  28. file.absent