Skip to content

Commit ea284bb

Browse files
committed
Add conditions to task
Mark as a test only if the tasks is run
1 parent 2bfdba6 commit ea284bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roles/common/tasks/cr_tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
condition_type: "{{ item.condition_type if item.condition_type is defined else '' }}"
2020

2121
- name: |
22-
Verify that the {{ item.kind }} {{ item.name }} CR is {{ condition_type }}
22+
{{ 'TEST' if condition_type | length > 0 }} Verify that the {{ item.kind }} {{ item.name }} CR is {{ condition_type }}
2323
{{ common_cr_ready_test_id if condition_type | length > 0 }}
2424
ansible.builtin.command:
2525
cmd: |
@@ -28,3 +28,6 @@
2828
changed_when: false
2929
failed_when:
3030
- result.stdout != "True"
31+
when:
32+
- common_cr_ready_test_id is defined
33+
- condition_type | length > 0

0 commit comments

Comments
 (0)