Set default images, but use them as a last resort

* Only use them if user did not set an image, or RELATED_IMAGES_ var
    is not set

Signed-off-by: Christian M. Adams <chadams@redhat.com>
(cherry picked from commit bb957be9e6)
This commit is contained in:
Christian M. Adams
2021-10-28 17:12:31 -04:00
committed by Yanis Guenane
parent 09088b5b18
commit 7eb6d0e0f5
8 changed files with 48 additions and 24 deletions

View File

@@ -63,6 +63,10 @@
when:
- backup_pvc == '' or backup_pvc is not defined
- name: Set default postgres image
set_fact:
_default_postgres_image: "{{ _postgres_image }}:{{_postgres_image_version }}"
- name: Set user provided postgres image
set_fact:
_custom_postgres_image: "{{ postgres_image }}:{{ postgres_image_version }}"
@@ -72,7 +76,7 @@
- name: Set Postgres image URL
set_fact:
_postgres_image: "{{ _custom_postgres_image | default(lookup('env', 'RELATED_IMAGE_AWX_POSTGRES')) }}"
_postgres_image: "{{ _custom_postgres_image | default(lookup('env', 'RELATED_IMAGE_AWX_POSTGRES')) | default(_default_postgres_image) }}"
- name: Create management pod from templated deployment config
k8s: