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.

30 line
913B

  1. {% from "logrotate/map.jinja" import logrotate with context %}
  2. include:
  3. - logrotate
  4. logrotate_directory:
  5. file.directory:
  6. - name: {{ logrotate.include_dir }}
  7. - user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
  8. - group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
  9. - mode: 755
  10. - makedirs: True
  11. - require:
  12. - pkg: logrotate
  13. logrotate_config:
  14. file.managed:
  15. - name: {{ logrotate.conf_file }}
  16. - source: salt://logrotate/files/{{ salt['grains.get']('os_family') }}/logrotate.conf
  17. - template: jinja
  18. - user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
  19. - group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
  20. - mode: {{ salt['pillar.get']('logrotate:config:mode', '644') }}
  21. - require:
  22. - pkg: logrotate
  23. - watch_in:
  24. - service: {{ logrotate.service }}