1
0
Fork 0
mirror of synced 2024-11-16 14:15:33 -05:00
formula-logrotate/logrotate/map.jinja
2017-02-14 17:13:57 +01:00

50 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',
},
},
'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 {}
%}
{% do default_settings.logrotate.update(os_map) %}
{% set logrotate = salt['pillar.get'](
'logrotate',
default=default_settings.logrotate,
merge=True
)
%}