Skip to content

Commit

Permalink
(hiera/common.yaml) add rsyslog log rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarria committed Jun 10, 2024
1 parent 9b38772 commit 150b34c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions hieradata/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,29 @@ rsyslog::config::inputs:
file: "/var/log/audit/audit.log"
Tag: "auditd"

files:
/etc/logrotate.d/rsyslog:
ensure: 'file'
owner: 'root'
group: 'root'
mode: '0644'
content: |
/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
size 50M
rotate 4
compress
delaycompress
missingok
sharedscripts
postrotate
/usr/bin/systemctl -s HUP kill rsyslog.service >/dev/null 2>&1 || true
endscript
}
yum::plugin::versionlock::clean: true # trigger `yum clean all`
yum::manage_os_default_repos: true

Expand Down
4 changes: 4 additions & 0 deletions spec/support/spec/rsyslog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
)
end

it do
is_expected.to contain_file('/etc/logrotate.d/rsyslog')
end

case site
when 'cp'
it do
Expand Down

0 comments on commit 150b34c

Please sign in to comment.