|
|
|
|
|
|
|
|
{% set logrotate = salt['grains.filter_by']({ |
|
|
|
|
|
'RedHat': { |
|
|
|
|
|
'pkg' : 'logrotate', |
|
|
|
|
|
'service' : 'crond', |
|
|
|
|
|
'conf_file' : '/etc/logrotate.conf', |
|
|
|
|
|
'include_dir' : '/etc/logrotate.d', |
|
|
|
|
|
'user' : 'root', |
|
|
|
|
|
'group' : 'root', |
|
|
|
|
|
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
|
# vim: ft=jinja |
|
|
|
|
|
|
|
|
|
|
|
{% set os_family_map = salt['grains.filter_by']({ |
|
|
|
|
|
'RedHat': { |
|
|
|
|
|
'service': 'crond', |
|
|
|
|
|
}, |
|
|
|
|
|
'Arch': { |
|
|
|
|
|
'service': 'logrotate.timer', |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
'ScientificLinux': { |
|
|
|
|
|
'pkg' : 'logrotate', |
|
|
|
|
|
'service' : 'crond', |
|
|
|
|
|
'conf_file' : '/etc/logrotate.conf', |
|
|
|
|
|
'include_dir' : '/etc/logrotate.d', |
|
|
|
|
|
'user' : 'root', |
|
|
|
|
|
'group' : 'root', |
|
|
|
|
|
}, |
|
|
|
|
|
'Arch': { |
|
|
|
|
|
'pkg' : 'logrotate', |
|
|
|
|
|
'service' : 'logrotate.timer', |
|
|
|
|
|
'conf_file' : '/etc/logrotate.conf', |
|
|
|
|
|
'include_dir' : '/etc/logrotate.d', |
|
|
|
|
|
'user' : 'root', |
|
|
|
|
|
'group' : 'root', |
|
|
|
|
|
}, |
|
|
|
|
|
'Debian': { |
|
|
|
|
|
'pkg' : 'logrotate', |
|
|
|
|
|
'service' : 'cron', |
|
|
|
|
|
'conf_file' : '/etc/logrotate.conf', |
|
|
|
|
|
'include_dir' : '/etc/logrotate.d', |
|
|
|
|
|
'user' : 'root', |
|
|
|
|
|
'group' : 'root', |
|
|
|
|
|
}, |
|
|
|
|
|
'Suse': { |
|
|
|
|
|
'pkg' : 'logrotate', |
|
|
|
|
|
'service' : 'cron', |
|
|
|
|
|
'conf_file' : '/etc/logrotate.conf', |
|
|
|
|
|
'include_dir' : '/etc/logrotate.d', |
|
|
|
|
|
'user' : 'root', |
|
|
|
|
|
'group' : 'root', |
|
|
|
|
|
}, |
|
|
|
|
|
}, merge=salt['pillar.get']('logrotate:lookup')) %} |
|
|
|
|
|
|
|
|
grain="os_family", |
|
|
|
|
|
merge=salt['pillar.get']('logrotate:lookup')) |
|
|
|
|
|
|
|
|
|
|
|
{% do default_settings.logrotate.update(os_family_map) %} |
|
|
|
|
|
|
|
|
|
|
|
{% set logrotate = salt['pillar.get']( |
|
|
|
|
|
'logrotate', |
|
|
|
|
|
default=default_settings.logrotate, |
|
|
|
|
|
merge=True |
|
|
|
|
|
) |
|
|
|
|
|
%} |