forked from ansible-lockdown/RHEL9-CIS
rsyslog_#294 thanks to @alopezgcp
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
2078657ceb
commit
d6a560b2c8
5 changed files with 107 additions and 69 deletions
|
|
@ -1,11 +0,0 @@
|
|||
/var/log/rsyslog/*.log {
|
||||
{{ rhel9cis_rsyslog_logrotate_rotated }}
|
||||
rotate {{ rhel9cis_rsyslog_logrotate_keep }}
|
||||
{% if rhel9cis_rsyslog_logrotate_compress %}compress{% else %}nocompress{% endif %}
|
||||
{% if rhel9cis_rsyslog_logrotate_missingok %}missingok{% else %}missingok{% endif %}
|
||||
{% if rhel9cis_rsyslog_logrotate_notifempty %}notifempty{% else %}ifempty{% endif %}
|
||||
{% if rhel9cis_rsyslog_logrotate_create %}create {{ rhel9cis_rsyslog_logrotate_create_opts }}{% endif %}
|
||||
postrotate
|
||||
/usr/bin/systemctl reload rsyslog.service >/dev/null || true
|
||||
endscript
|
||||
}
|
||||
26
templates/etc/logrotate.d/rsyslog_log.j2
Normal file
26
templates/etc/logrotate.d/rsyslog_log.j2
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/var/log/rsyslog/*.log {
|
||||
{{ rhel9cis_rsyslog_logrotate_rotated_when }}
|
||||
rotate {{ rhel9cis_rsyslog_logrotate_rotatation_keep }}
|
||||
{% if rhel9cis_rsyslog_logrotate_compress %}
|
||||
compress
|
||||
{% else %}
|
||||
nocompress
|
||||
{% endif %}
|
||||
{% if rhel9cis_rsyslog_logrotate_missingok %}
|
||||
missingok
|
||||
{% else %}
|
||||
nomissingok
|
||||
{% endif %}
|
||||
{% if rhel9cis_rsyslog_logrotate_notifempty %}
|
||||
notifempty
|
||||
{% else %}
|
||||
ifempty
|
||||
{% endif %}
|
||||
{% if rhel9cis_rsyslog_logrotate_create %}
|
||||
create{% if rhel9cis_rsyslog_logrotate_create_opts is defined %} {{ rhel9cis_rsyslog_logrotate_create_opts }}{% endif %}
|
||||
{% endif %}
|
||||
|
||||
postrotate
|
||||
/usr/bin/systemctl reload rsyslog.service >/dev/null || true
|
||||
endscript
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue