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.

54 lines
1.2KB

  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. 'Debian': {
  12. 'default_config': {
  13. 'compress': True,
  14. },
  15. },
  16. 'RedHat': {
  17. 'service': 'crond',
  18. 'default_config': {
  19. 'dateext': True,
  20. },
  21. },
  22. 'Suse': {
  23. 'login_records_jobs': False,
  24. 'default_config': {
  25. 'dateext': True,
  26. 'compresscmd': '/usr/bin/xz',
  27. 'uncompresscmd': '/usr/bin/xzdec',
  28. },
  29. },
  30. },
  31. grain="os_family",
  32. merge=salt['pillar.get']('logrotate:lookup')) or {}
  33. %}
  34. {% set os_map = salt['grains.filter_by']({
  35. 'Ubuntu': {
  36. 'default_config': {
  37. 'su': 'root syslog'
  38. },
  39. },
  40. },
  41. grain="os",
  42. merge=os_family_map) or {}
  43. %}
  44. {% set logrotate = salt['grains.filter_by'](
  45. default_settings,
  46. merge=os_map,
  47. base='logrotate',
  48. )
  49. %}