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

@@ -47,6 +47,10 @@
- old_pg_config['resources'] | length
no_log: true
- name: Set default postgres image
set_fact:
_default_postgres_image: "{{ _postgres_image }}:{{_postgres_image_version }}"
- name: Set PostgreSQL configuration
set_fact:
_pg_config: '{{ _custom_pg_config_resources["resources"] | default([]) | length | ternary(_custom_pg_config_resources, _default_pg_config_resources) }}'
@@ -61,7 +65,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) }}"
- block:
- name: Create Database configuration