Saltstack Official Logrotate Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. %}