1
0
Fork 0
mirror of synced 2024-12-21 21:51:09 -05:00
formula-logrotate/logrotate/map.jinja
2017-03-29 18:06:25 +13:00

53 lines
1.2 KiB
Django/Jinja

# -*- coding: utf-8 -*-
# vim: ft=jinja
{% import_yaml 'logrotate/defaults.yaml' as default_settings %}
{% set os_family_map = salt['grains.filter_by']({
'Arch': {
'service': 'logrotate.timer',
'default_config': {
'tabooext': '+ .pacorig .pacnew .pacsave',
},
},
'Debian': {
'default_config': {
'compress': True,
},
},
'RedHat': {
'service': 'crond',
'default_config': {
'dateext': True,
},
},
'Suse': {
'login_records_jobs': False,
'default_config': {
'dateext': True,
'compresscmd': '/usr/bin/xz',
'uncompresscmd': '/usr/bin/xzdec',
},
},
},
grain="os_family",
merge=salt['pillar.get']('logrotate:lookup')) or {}
%}
{% set os_map = salt['grains.filter_by']({
'Ubuntu': {
'default_config': {
'su': 'root syslog'
},
},
},
grain="os",
merge=os_family_map) or {}
%}
{% set logrotate = salt['grains.filter_by'](
default_settings,
merge=os_map,
base='logrotate',
)
%}