Skip to content

Commit 9180cdd

Browse files
committed
Add conditions to task
Mark as a test only if the tasks is run
1 parent 03ed468 commit 9180cdd

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
@@ -18,7 +18,7 @@
1818
condition_type: "{{ item.condition_type if item.condition_type is defined else '' }}"
1919

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

0 commit comments

Comments
 (0)