Saltstack Official Logrotate 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.

25 lines
805B

  1. {% from "logrotate/map.jinja" import logrotate with context %}
  2. include:
  3. - logrotate
  4. logrotate-config:
  5. file.managed:
  6. - name: {{ logrotate.conf_file }}
  7. - source: salt://logrotate/templates/logrotate.conf.tmpl
  8. - template: jinja
  9. - user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
  10. - group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
  11. - mode: {{ salt['pillar.get']('logrotate:config:mode', '644') }}
  12. - context:
  13. logrotate: {{ logrotate|tojson }}
  14. logrotate-directory:
  15. file.directory:
  16. - name: {{ logrotate.include_dir }}
  17. - user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
  18. - group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
  19. - mode: 755
  20. - makedirs: True