evolinux-base: logs are rotated with dateext by default
This commit is contained in:
parent
4a035d248d
commit
9b479f9c05
|
@ -59,6 +59,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
||||||
* evolinux-base: force Debian version to buster for Evolix repository (temporary)
|
* evolinux-base: force Debian version to buster for Evolix repository (temporary)
|
||||||
* evolinux-base: split dpkg logrotate configuration
|
* evolinux-base: split dpkg logrotate configuration
|
||||||
* evolinux-base: install freeipmi by default on dedicated hw
|
* evolinux-base: install freeipmi by default on dedicated hw
|
||||||
|
* evolinux-base: logs are rotated with dateext by default
|
||||||
* kibana: 7.x by default
|
* kibana: 7.x by default
|
||||||
* listupgrade: upstream release 21.06.3
|
* listupgrade: upstream release 21.06.3
|
||||||
* logstash: elastic_stack_version = 7.x
|
* logstash: elastic_stack_version = 7.x
|
||||||
|
|
|
@ -164,8 +164,10 @@ evolinux_logs_include: True
|
||||||
|
|
||||||
evolinux_logs_logrotate_confs: True
|
evolinux_logs_logrotate_confs: True
|
||||||
evolinux_logs_default_rotate: True
|
evolinux_logs_default_rotate: True
|
||||||
|
evolinux_logs_default_dateext : True
|
||||||
evolinux_logs_disable_logrotate_rsyslog: True
|
evolinux_logs_disable_logrotate_rsyslog: True
|
||||||
evolinux_logs_rsyslog_conf: True
|
evolinux_logs_rsyslog_conf: True
|
||||||
|
evolinux_logrotate_dateformat: "-%Y%m%d%H"
|
||||||
|
|
||||||
# default www
|
# default www
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
/var/log/procmail.log {
|
/var/log/procmail.log {
|
||||||
daily
|
daily
|
||||||
rotate 365
|
rotate 365
|
||||||
dateext
|
|
||||||
dateyesterday
|
|
||||||
dateformat .%Y%m%d
|
|
||||||
missingok
|
missingok
|
||||||
rotate 365
|
|
||||||
create 640 root adm
|
create 640 root adm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,34 @@
|
||||||
dest: /etc/logrotate.d/zsyslog
|
dest: /etc/logrotate.d/zsyslog
|
||||||
when: evolinux_logs_logrotate_confs | bool
|
when: evolinux_logs_logrotate_confs | bool
|
||||||
|
|
||||||
- name: Configure logrotate.conf
|
- name: Configure logrotate.conf default rotate value
|
||||||
replace:
|
replace:
|
||||||
dest: /etc/logrotate.conf
|
dest: /etc/logrotate.conf
|
||||||
regexp: "rotate [0-9]+"
|
regexp: "rotate [0-9]+"
|
||||||
replace: "rotate 12"
|
replace: "rotate 12"
|
||||||
when: evolinux_logs_default_rotate | bool
|
when: evolinux_logs_default_rotate | bool
|
||||||
|
|
||||||
|
- name: Enable logrotate.conf dateext option
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/logrotate.conf
|
||||||
|
line: "dateext"
|
||||||
|
regexp: "^#?\\s*dateext"
|
||||||
|
when: evolinux_logs_default_dateext | bool
|
||||||
|
|
||||||
|
- name: Enable logrotate.conf dateformat option
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/logrotate.conf
|
||||||
|
line: "dateformat {{ evolinux_logrotate_dateformat | mandatory }}"
|
||||||
|
regexp: "^#?\\s*dateformat.*"
|
||||||
|
insertafter: 'dateext'
|
||||||
|
when: evolinux_logs_default_dateext | bool
|
||||||
|
|
||||||
|
- name: Disable logrotate.conf dateyesterday option
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/logrotate.conf
|
||||||
|
line: "# dateyesterday"
|
||||||
|
regexp: "^\\s*dateyesterday"
|
||||||
|
insertafter: 'dateext'
|
||||||
|
when: evolinux_logs_default_dateext | bool
|
||||||
|
|
||||||
- meta: flush_handlers
|
- meta: flush_handlers
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
# Custom EvoLinux
|
# Custom EvoLinux
|
||||||
create 640 root adm
|
create 640 root adm
|
||||||
|
{% if not evolinux_logs_default_dateext %}
|
||||||
|
# BEGIN legacy setting
|
||||||
|
# … when global dateext and dateformat are not enabled
|
||||||
dateext
|
dateext
|
||||||
dateyesterday
|
dateyesterday
|
||||||
dateformat .%Y%m%d
|
dateformat .%Y%m%d
|
||||||
|
# END legacy setting
|
||||||
|
{% endif %}
|
||||||
missingok
|
missingok
|
||||||
notifempty
|
notifempty
|
||||||
delaycompress
|
delaycompress
|
||||||
|
|
Loading…
Reference in a new issue