2021-01-23 14:25:35 +01:00
|
|
|
---
|
2021-01-23 14:41:25 +01:00
|
|
|
- name: Install logrotate
|
|
|
|
apt:
|
2021-03-30 07:45:52 +02:00
|
|
|
name: logrotate
|
2021-03-30 06:01:43 +02:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Create rsyslog configuration directory
|
|
|
|
file:
|
|
|
|
path: /etc/rsyslog.d
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u=rwx,g=rx,o=rx
|
2021-01-23 14:25:35 +01:00
|
|
|
|
|
|
|
- name: Configure logrotate
|
|
|
|
template:
|
2021-03-30 06:01:43 +02:00
|
|
|
src: logrotate.conf
|
|
|
|
dest: /etc/logrotate.conf
|
2021-01-23 14:25:35 +01:00
|
|
|
owner: root
|
2021-01-23 15:59:03 +01:00
|
|
|
group: root
|
2021-03-30 06:01:43 +02:00
|
|
|
mode: u=rwx,g=r,o=r
|
|
|
|
notify: Reload logrotate
|
2021-01-23 14:25:35 +01:00
|
|
|
|
|
|
|
- name: Enable logrotate service
|
2021-03-30 06:01:43 +02:00
|
|
|
systemd:
|
|
|
|
name: logrotate.service
|
2021-01-23 14:25:35 +01:00
|
|
|
enabled: true
|
|
|
|
state: started
|
2021-03-30 06:01:43 +02:00
|
|
|
...
|