[feat] Move logrotate configuration settings to pillar

This commit is contained in:
William Wernert
2020-10-06 13:22:44 -04:00
parent 94f15c63ce
commit 9737b01676
3 changed files with 15 additions and 9 deletions

11
pillar/logrotate/init.sls Normal file
View File

@@ -0,0 +1,11 @@
logrotate:
conf: |
daily
rotate 14
missingok
copytruncate
nocompress
create
extension .log
dateext
dateyesterday

View File

@@ -1,6 +1,7 @@
base:
'*':
- patch.needs_restarting
- logrotate
'*_eval or *_helix or *_heavynode or *_sensor or *_standalone or *_import':
- match: compound

View File

@@ -1,3 +1,5 @@
{%- set logrotate_conf = salt['pillar.get']['logrotate:conf'] %}
/opt/so/log/aptcacher-ng/*.log
/opt/so/log/idstools/*.log
/opt/so/log/nginx/*.log
@@ -13,13 +15,5 @@
/opt/so/log/telegraf/*.log
/opt/so/log/redis/*.log
{
daily
rotate 2
missingok
copytruncate
nocompress
create
extension .log
dateext
dateyesterday
{{ logrotate_conf }}
}