From de738f39c1f05063e3caaeed9aa3433baf229652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 13 Jan 2025 11:19:51 +0100 Subject: [PATCH] Add logrotate configuration for chill logs This commit introduces log rotation for chill-related logs by adding a template file and the corresponding task in the playbook. It ensures proper log management by rotating logs daily, keeping a specified number of backups, and compressing old logs. --- tasks/main.yml | 8 ++++++++ templates/logrotate/chill | 15 +++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 templates/logrotate/chill diff --git a/tasks/main.yml b/tasks/main.yml index 7c348a7..be15e44 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -37,6 +37,14 @@ group: 33 mode: '0774' +- name: Configure logrotate for chill + ansible.builtin.template: + dest: /etc/logrotate/logrotate.d/chill + src: logrotate/chill + owner: root + group: root + mode: '0644' + - name: Install traefik ansible.builtin.include_tasks: traefik.yml diff --git a/templates/logrotate/chill b/templates/logrotate/chill new file mode 100644 index 0000000..21a6085 --- /dev/null +++ b/templates/logrotate/chill @@ -0,0 +1,15 @@ +/var/log/chill/default-*.log { + rotate 90 + daily + compress + missingok + notifempty +} + +/var/log/apt/private-*.log { + rotate 180 + daily + compress + missingok + notifempty +} \ No newline at end of file