Initialize registry_namespaces unconditionally if not initialized

The deploy-env playbook can fail with an error stating that
registry_namespaces is not defined in some cases. This change moves
the initialization of registry_namespaces so that buildset_registry
is not required for it to be set when other conditions are not met.

Change-Id: I160e7d479008fd3afd460382691673b92bd042c9
This commit is contained in:
Stephen Taylor 2023-12-06 12:15:57 -07:00
parent ee22dd9b4e
commit 426c71f753

View File

@ -80,6 +80,11 @@
skip_verify: true
when: registry_mirror is defined
- name: Init registry_namespaces if not defined
set_fact:
registry_namespaces: "[]"
when: not registry_namespaces is defined
- name: Buildset registry namespace
when: buildset_registry is defined
block:
@ -106,11 +111,6 @@
ca: "/usr/local/share/ca-certificates/{{ buildset_registry_alias }}.crt"
auth: "{{ (buildset_registry.username + ':' + buildset_registry.password) | b64encode }}"
- name: Init registry_namespaces if not defined
set_fact:
registry_namespaces: "[]"
when: not registry_namespaces is defined
- name: Append buildset_registry to registry namespaces
when:
- buildset_registry_namespace is defined