Skip to content

Commit 150b34c

Browse files
committed
(hiera/common.yaml) add rsyslog log rotate
1 parent 9b38772 commit 150b34c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

hieradata/common.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,29 @@ rsyslog::config::inputs:
330330
file: "/var/log/audit/audit.log"
331331
Tag: "auditd"
332332

333+
files:
334+
/etc/logrotate.d/rsyslog:
335+
ensure: 'file'
336+
owner: 'root'
337+
group: 'root'
338+
mode: '0644'
339+
content: |
340+
/var/log/cron
341+
/var/log/maillog
342+
/var/log/messages
343+
/var/log/secure
344+
/var/log/spooler
345+
{
346+
size 50M
347+
rotate 4
348+
compress
349+
delaycompress
350+
missingok
351+
sharedscripts
352+
postrotate
353+
/usr/bin/systemctl -s HUP kill rsyslog.service >/dev/null 2>&1 || true
354+
endscript
355+
}
333356
yum::plugin::versionlock::clean: true # trigger `yum clean all`
334357
yum::manage_os_default_repos: true
335358

spec/support/spec/rsyslog.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
)
7575
end
7676

77+
it do
78+
is_expected.to contain_file('/etc/logrotate.d/rsyslog')
79+
end
80+
7781
case site
7882
when 'cp'
7983
it do

0 commit comments

Comments
 (0)