From 7e0d8f1cfc297b6959405ee43bae2f62b06dc130 Mon Sep 17 00:00:00 2001 From: Samuel Rac Date: Wed, 18 Feb 2026 14:33:08 +0000 Subject: [PATCH] [reportportal]: avoid downloading the data router binary if it is already available These changes improve the performance of the role by avoiding downloading the data router at each call of the role. It is particularly important when calling it multiple times in the same job. Signed-off-by: Samuel Rac --- roles/reportportal/tasks/main.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/roles/reportportal/tasks/main.yaml b/roles/reportportal/tasks/main.yaml index 5cde268c8b..67696e87db 100644 --- a/roles/reportportal/tasks/main.yaml +++ b/roles/reportportal/tasks/main.yaml @@ -29,6 +29,12 @@ state: directory mode: "0755" +- name: Check if Data router client binary is already present + ansible.builtin.stat: + path: "{{ cifmw_reportportal_droute_dir }}/{{ cifmw_reportportal_droute_binary }}" + register: droute_binary_stat + when: not cifmw_reportportal_dry_run | bool + - name: Get the Data router client vars: _droute_url: >- @@ -38,12 +44,16 @@ cifmw_reportportal_droute_binary) | path_join }} + _droute_dest: "{{ cifmw_reportportal_droute_dir }}/{{ cifmw_reportportal_droute_binary }}" ansible.builtin.get_url: url: "{{ _droute_url }}" - dest: "{{ cifmw_reportportal_droute_dir }}" + dest: "{{ _droute_dest }}" backup: true mode: "0755" - when: not cifmw_reportportal_dry_run | bool + when: + - not cifmw_reportportal_dry_run | bool + - droute_binary_stat is not skipped + - not droute_binary_stat.stat.exists - name: Create the metadata file ansible.builtin.template: