Move common settings to defaults.yaml
This commit is contained in:
parent
084a1cfda5
commit
1c6661a485
2 changed files with 32 additions and 41 deletions
11
logrotate/defaults.yaml
Normal file
11
logrotate/defaults.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
|
||||||
|
logrotate:
|
||||||
|
pkg: logrotate
|
||||||
|
conf_file: '/etc/logrotate.conf'
|
||||||
|
include_dir: '/etc/logrotate.d'
|
||||||
|
user: root
|
||||||
|
group: root
|
||||||
|
service: cron
|
||||||
|
|
|
@ -1,42 +1,22 @@
|
||||||
{% set logrotate = salt['grains.filter_by']({
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=jinja
|
||||||
|
|
||||||
|
{% set os_family_map = salt['grains.filter_by']({
|
||||||
'RedHat': {
|
'RedHat': {
|
||||||
'pkg' : 'logrotate',
|
'service': 'crond',
|
||||||
'service' : 'crond',
|
|
||||||
'conf_file' : '/etc/logrotate.conf',
|
|
||||||
'include_dir' : '/etc/logrotate.d',
|
|
||||||
'user' : 'root',
|
|
||||||
'group' : 'root',
|
|
||||||
},
|
|
||||||
'ScientificLinux': {
|
|
||||||
'pkg' : 'logrotate',
|
|
||||||
'service' : 'crond',
|
|
||||||
'conf_file' : '/etc/logrotate.conf',
|
|
||||||
'include_dir' : '/etc/logrotate.d',
|
|
||||||
'user' : 'root',
|
|
||||||
'group' : 'root',
|
|
||||||
},
|
},
|
||||||
'Arch': {
|
'Arch': {
|
||||||
'pkg' : 'logrotate',
|
'service': 'logrotate.timer',
|
||||||
'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': {
|
grain="os_family",
|
||||||
'pkg' : 'logrotate',
|
merge=salt['pillar.get']('logrotate:lookup'))
|
||||||
'service' : 'cron',
|
|
||||||
'conf_file' : '/etc/logrotate.conf',
|
{% do default_settings.logrotate.update(os_family_map) %}
|
||||||
'include_dir' : '/etc/logrotate.d',
|
|
||||||
'user' : 'root',
|
{% set logrotate = salt['pillar.get'](
|
||||||
'group' : 'root',
|
'logrotate',
|
||||||
},
|
default=default_settings.logrotate,
|
||||||
}, merge=salt['pillar.get']('logrotate:lookup')) %}
|
merge=True
|
||||||
|
)
|
||||||
|
%}
|
||||||
|
|
Loading…
Reference in a new issue