fix: Correct the image_version conditional (#2082)

* fix: Correct the image_version conditional

When image is set and image_version is unset, the conditional is failing
due to the unset variable causes and error.
Implemented the correct conditional and added an assert to validate that
both variables are set properly when image is set.

Signed-off-by: Lucas Benedito <lbenedit@redhat.com>
This commit is contained in:
lucas-benedito
2025-10-09 18:34:50 +01:00
committed by GitHub
parent bed4aff4cc
commit 78864b3653
2 changed files with 15 additions and 4 deletions

View File

@@ -224,7 +224,7 @@
_custom_image: "{{ image }}:{{ image_version }}"
when:
- image | default([]) | length
- image_version is defined or image_version != ''
- image_version is defined and image_version != ''
- name: Set AWX app image URL
set_fact:
@@ -239,7 +239,7 @@
_custom_redis_image: "{{ redis_image }}:{{ redis_image_version }}"
when:
- redis_image | default([]) | length
- redis_image_version is defined or redis_image_version != ''
- redis_image_version is defined and redis_image_version != ''
- name: Set Redis image URL
set_fact: