Fix gating repo for mixed OS content providers

This is not taking into account the mixed OS job where we
need to use registry_ip_address_distro instead of
registry_ip_address_branch.

The _branch is still default, and we override with _distro when
it is in use (i.e. when it has more than one key). The current
code causes related-bug because we end up trying to install
tripleoclient from the *8* content provider for the *9*
undercloud.

Related-Bug: 1983004
Change-Id: Ic77a58ce04153d9ee70772284a13fe1c37d9350f
This commit is contained in:
Marios Andreou 2022-07-29 16:40:33 +03:00
parent 77d9ebffe6
commit 666d733213
1 changed files with 10 additions and 3 deletions

View File

@ -1,9 +1,16 @@
---
- hosts: all
vars:
gating_repo_loop_input: "{{ dict(registry_ip_address_branch|default({})) }}"
tasks:
- when: registry_ip_address_branch is defined
block:
- name: override gating_repo_loop_input if we have distro.keys
when:
- registry_ip_address_distro is defined
- registry_ip_address_distro.keys() | length > 1
set_fact:
gating_repo_loop_input: "{{ dict(registry_ip_address_distro) }}"
# Check if we have built something in content provider.
# If we did - create a gating-repo pointing to content provider. The
@ -13,10 +20,10 @@
wait_for:
timeout: 2
port: 8766
host: '{{ registry_ip_address_branch[item.key] }}'
host: '{{ gating_repo_loop_input[item.key] }}'
register: waitfor
ignore_errors: true
loop: '{{ registry_ip_address_branch | dict2items }}'
loop: '{{ gating_repo_loop_input | dict2items }}'
# create the gating repo for any branch defined in
# registry_ip_address_branch.