From bb956fb5e7943e1fc15ec11de595f04887ba00e4 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 23 Aug 2018 13:02:25 +0200 Subject: [PATCH] apache: logrotate replacement is more subtle/precise It replaces only the proper directive and not every occurence of the word. --- CHANGELOG.md | 1 + apache/tasks/main.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62790ee1..030606f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ The **patch** part changes incrementally at each release. * kvm-host: install kvm-tools package instead of copying add-vm.sh ### Fixed +* apache: logrotate replacement is more subtle/precise. It replaces only the proper directive and not every occurence of the word. * bind: chroot-bind.sh must not be executed in check mode * evoacme: fix module detection in apache config * fail2ban: fix fail2ban_ignore_ips definition diff --git a/apache/tasks/main.yml b/apache/tasks/main.yml index 6801ba22..19858569 100644 --- a/apache/tasks/main.yml +++ b/apache/tasks/main.yml @@ -174,8 +174,8 @@ - name: "logrotate: keep 52 files" replace: dest: /etc/logrotate.d/apache2 - regexp: "rotate .+" - replace: "rotate 52" + regexp: '^(\s+rotate) \d+$' + replace: '\1 52' tags: - apache