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.

58 lines
1.3KB

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