diff --git a/ci_framework/roles/artifacts/tasks/main.yml b/ci_framework/roles/artifacts/tasks/main.yml index 810ff768bb..af41a0ce72 100644 --- a/ci_framework/roles/artifacts/tasks/main.yml +++ b/ci_framework/roles/artifacts/tasks/main.yml @@ -56,15 +56,14 @@ - always ansible.builtin.import_tasks: cleanup.yml -- name: Gather logs when forced or tests failed +- name: Run must gather logs when forced or tests failed when: cifmw_artifacts_gather_logs | bool or not cifmw_success_flag.stat.exists - block: - - name: Run os_must_gather - ansible.builtin.import_role: - name: os_must_gather - rescue: - - name: Get CRC logs if os_must_gather failed - ansible.builtin.import_tasks: crc.yml - always: - - name: Get EDPM logs - ansible.builtin.import_tasks: edpm.yml + ansible.builtin.import_role: + name: os_must_gather + +- name: Collect crc logs when tests successed + when: not cifmw_artifacts_gather_logs | bool or cifmw_success_flag.stat.exists + ansible.builtin.import_tasks: crc.yml + +- name: Get EDPM logs + ansible.builtin.import_tasks: edpm.yml