Skip to content

Commit

Permalink
Fix podified/edpm log collection
Browse files Browse the repository at this point in the history
#457
enables running os_must_gather role in case of failure but also
addes resuce task to run crc and edpm log collection.

Since os_must_gather role runs must_gather tool to do the log
collection and if must_gather fails, it also resuces operation
to collect more logs on the node. The task associated with calling
os_must_gather role is always going to get skipped if the job
passes and we have no log collection for edpm and podified.

Developers have no logs to verify/check few things in passed
jobs.

This pr fixes the same by running crc task file in case of passing
job and os_must_gather role in case of failed job. We should
always run edpm task files to collect edpm logs.

Signed-off-by: Chandan Kumar <raukadah@gmail.com>
  • Loading branch information
raukadah committed Aug 25, 2023
1 parent 8c5c79a commit bbad571
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ci_framework/roles/artifacts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bbad571

Please sign in to comment.