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.

49 lines
1.1KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=jinja
  3. {% import_yaml 'logrotate/defaults.yaml' as default_settings %}
  4. {% set os_family_map = salt['grains.filter_by']({
  5. 'Arch': {
  6. 'service': 'logrotate.timer',
  7. 'default_config': {
  8. 'tabooext': '+ .pacorig .pacnew .pacsave',
  9. },
  10. },
  11. 'RedHat': {
  12. 'service': 'crond',
  13. 'default_config': {
  14. 'dateext': True,
  15. },
  16. },
  17. 'Suse': {
  18. 'login_records_jobs': False,
  19. 'default_config': {
  20. 'dateext': True,
  21. 'compresscmd': '/usr/bin/xz',
  22. 'uncompresscmd': '/usr/bin/xzdec',
  23. },
  24. },
  25. },
  26. grain="os_family",
  27. merge=salt['pillar.get']('logrotate:lookup')) or {}
  28. %}
  29. {% set os_map = salt['grains.filter_by']({
  30. 'Ubuntu': {
  31. 'default_config': {
  32. 'su': 'root syslog'
  33. },
  34. },
  35. },
  36. grain="os",
  37. merge=os_family_map) or {}
  38. %}
  39. {% set logrotate = salt['grains.filter_by'](
  40. default_settings,
  41. merge=os_map,
  42. base='logrotate',
  43. )
  44. %}