Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
27 changes: 27 additions & 0 deletions spec/support/spec/rsyslog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,33 @@
)
end

it do
is_expected.to contain_file('/etc/logrotate.d/rsyslog').with(
ensure: 'file',
owner: 'root',
group: 'root',
mode: '0644',
content: <<~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
}
CONTENT
)
end

case site
when 'cp'
it do
Expand Down