From 0c404a59289a825e1c87dbbf47fa6c24b64b86ad Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Fri, 30 Jun 2023 17:07:26 +0200 Subject: [PATCH] workaround for filebeat: add newline at the end of xml reports filebeat is unable to read xml files with results when they do not finish with an empty line Change-Id: I326192a784b652c2129d63d1b5fbf0bce8cd3a16 --- roles/tobiko-collect/tasks/main.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/tobiko-collect/tasks/main.yaml b/roles/tobiko-collect/tasks/main.yaml index d0c8a5b3e..97d5b9753 100644 --- a/roles/tobiko-collect/tasks/main.yaml +++ b/roles/tobiko-collect/tasks/main.yaml @@ -39,6 +39,13 @@ json_query("[?stat.exists].stat.path") }} +- name: "workaround for Filebeat - add newline to the end of xml report" + lineinfile: + dest: '{{ item }}' + line: '' + loop: '{{ report_files }}' + when: item.endswith('xml') + - name: "collect report files to local directory '{{ collect_dir }}'" synchronize: dest: '{{ collect_dir }}/{{ item | basename }}'