Skip to content

Commit

Permalink
Add conditions to task
Browse files Browse the repository at this point in the history
Mark as a test only if the tasks is run
  • Loading branch information
elfiesmelfie committed Feb 14, 2025
1 parent 6c848ae commit 60bd683
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion roles/common/tasks/cr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
condition_type: "{{ item.condition_type if item.condition_type is defined else '' }}"

- name: |
Verify that the {{ item.kind }} {{ item.name }} CR is {{ condition_type }}
{{ 'TEST' if condition_type | length > 0 }} Verify that the {{ item.kind }} {{ item.name }} CR is {{ condition_type }}
{{ common_cr_ready_test_id if condition_type | length > 0 }}
ansible.builtin.command:
cmd: |
Expand All @@ -28,3 +28,6 @@
changed_when: false
failed_when:
- result.stdout != "True"
when:
- common_cr_ready_test_id is defined
- condition_type | length > 0

0 comments on commit 60bd683

Please sign in to comment.