From 2c079755e984558ae93d94f1617a2120471eebb7 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Wed, 31 May 2023 17:25:08 +0200 Subject: [PATCH] elasticsearch: comment the Xlog:gc line instead of changing it completely --- CHANGELOG.md | 1 + elasticsearch/tasks/configuration.yml | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3df84a35..788c871f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The **patch** part changes is incremented if multiple releases happen the same m ### Fixed +* elasticsearch: comment the Xlog:gc line instead of changing it completely * nagios-nrpe: remount /usr **after** installing the packages * packweb-apache,nagios-nrpe: add missing task and config for PHP 8.2 container * potsfix: add missing `localhost.$mydomain` to mydestination diff --git a/elasticsearch/tasks/configuration.yml b/elasticsearch/tasks/configuration.yml index 0b601aff..223eff90 100644 --- a/elasticsearch/tasks/configuration.yml +++ b/elasticsearch/tasks/configuration.yml @@ -179,14 +179,11 @@ tags: - config -- name: Disable garbage collector logs (JDK >= 9) - ansible.builtin.lineinfile: +- name: Disable garbage collector logs + ansible.builtin.replace: dest: /etc/elasticsearch/jvm.options - regexp: "Xlog:gc" - line: "#9-:-Xlog:gc*,gc+age=trace,safepoint:file=/opt/my-app/gc.log:utctime,pid,tags:filecount=32,filesize=64m" - owner: root - group: elasticsearch - mode: "0640" + regexp: '^([^#]*-Xlog:gc.+)' + replace: '#\1' tags: - config