From 14d8eaac2f1e19b8ea73cf25d88434b7c2686142 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Mon, 22 Jun 2020 19:02:29 +0200 Subject: [PATCH] haproxy: rotate logs with date extension and immediate compression --- CHANGELOG.md | 1 + haproxy/tasks/main.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a618aa3..0b0d7f32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ The **patch** part changes incrementally at each release. * haproxy: chroot and socket path are configurable * haproxy: adapt backports installed package list to distibution * haproxy: split stats variables +* haproxy: rotate logs with date extension and immediate compression * nginx: read server-status values before changing the config * redis: create sudoers file if missing * redis: new syntax for match filter diff --git a/haproxy/tasks/main.yml b/haproxy/tasks/main.yml index 04f08d39..78929bb0 100644 --- a/haproxy/tasks/main.yml +++ b/haproxy/tasks/main.yml @@ -101,4 +101,24 @@ - haproxy - config +- name: Rotate logs with dateext + lineinfile: + dest: /etc/logrotate.d/haproxy + line: ' dateext' + regexp: '^\s*#*\s*(no)?dateext' + insertbefore: '}' + tags: + - haproxy + - config + +- name: Rotate logs with nodelaycompress + lineinfile: + dest: /etc/logrotate.d/haproxy + line: ' nodelaycompress' + regexp: '^\s*#*\s*(no)?delaycompress' + insertbefore: '}' + tags: + - haproxy + - config + - include: munin.yml