From bdf534fdbb3d45207b6e9cd2fe8c59afaa87ac12 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Wed, 12 Apr 2017 18:04:09 +0200 Subject: [PATCH] Varnish: fix logrotate replace it was not idempotent and would add a segment indefinitely --- varnish/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/varnish/tasks/main.yml b/varnish/tasks/main.yml index b480a854..5815ec47 100644 --- a/varnish/tasks/main.yml +++ b/varnish/tasks/main.yml @@ -32,8 +32,8 @@ - name: Patch logrotate conf replace: name: /etc/logrotate.d/varnish - regexp: "/usr/sbin/invoke-rc.d {{item}} reload.*$" - replace: "systemctl -q is-active {{item}} && /usr/sbin/invoke-rc.d {{item}} reload > /dev/null ||true" + regexp: '^(\s+)(/usr/sbin/invoke-rc.d {{item}}.*)' + replace: '\1systemctl -q is-active {{item}} && \2' with_items: - varnishlog - varnishncsa