File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff 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 10k
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+ }
333356yum::plugin::versionlock::clean : true # trigger `yum clean all`
334357yum::manage_os_default_repos : true
335358
Original file line number Diff line number Diff line change 7474 )
7575 end
7676
77+ it do
78+ is_expected . to contain_file ( '/etc/logrotate.d/rsyslog' ) . with (
79+ ensure : 'file' ,
80+ owner : 'root' ,
81+ group : 'root' ,
82+ mode : '0644' ,
83+ content : <<~CONTENT ,
84+ /var/log/cron
85+ /var/log/maillog
86+ /var/log/messages
87+ /var/log/secure
88+ /var/log/spooler
89+ {
90+ size 50M
91+ rotate 4
92+ compress
93+ delaycompress
94+ missingok
95+ sharedscripts
96+ postrotate
97+ /usr/bin/systemctl -s HUP kill rsyslog.service >/dev/null 2>&1 || true
98+ endscript
99+ }
100+ CONTENT
101+ )
102+ end
103+
77104 case site
78105 when 'cp'
79106 it do
You can’t perform that action at this time.
0 commit comments