Varnish: fix logrotate replace

it was not idempotent and would add a segment indefinitely
This commit is contained in:
Jérémy Lecour 2017-04-12 18:04:09 +02:00 committed by Jérémy Lecour
parent 86372199ec
commit bdf534fdbb

View file

@ -32,8 +32,8 @@
- name: Patch logrotate conf - name: Patch logrotate conf
replace: replace:
name: /etc/logrotate.d/varnish name: /etc/logrotate.d/varnish
regexp: "/usr/sbin/invoke-rc.d {{item}} reload.*$" regexp: '^(\s+)(/usr/sbin/invoke-rc.d {{item}}.*)'
replace: "systemctl -q is-active {{item}} && /usr/sbin/invoke-rc.d {{item}} reload > /dev/null ||true" replace: '\1systemctl -q is-active {{item}} && \2'
with_items: with_items:
- varnishlog - varnishlog
- varnishncsa - varnishncsa