Fix setting custom mirror/pypi FQDNs for CI repro

Fix undefined value substituted for mirror_fqdn, when there is no
mirror_path defined in inventory variables used for the zuul-based CI
reproducer.

Ditch confusing alternative variable mirror_path and use mirror_fqdn as
it directly comes from zuul ansible variables. For compatibility sakes,
if mirror_path is in inventory, its value will be used for mirror_fqdn
in zuul playbooks.

Also pass for zuul playbooks pypi_fqdn, if defined.
If pypi_fqdn is skipped, custom mirror_fqdn always also overwrites
the used (and trusted) pypi mirror, what might be undesired, like
when configuring different mirrors for packages versus pip eggs.

For the depreceted reproducer, wire in mirror_fqdn as well.

Depends-On: https://review.opendev.org/696337

Change-Id: I9f87ea6335ce0a0b7c3e8c4cb1fe00187f474dd1
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2019-11-27 10:34:15 +01:00
parent 8a35edf9b9
commit 849e2fe485
3 changed files with 7 additions and 7 deletions

View File

@ -368,7 +368,7 @@ cat >>"{{ env_vars_to_source_file }}" <<EOF
# Uncomment this if you have established docker proxy on virthost # Uncomment this if you have established docker proxy on virthost
# export NODEPOOL_DOCKER_REGISTRY_PROXY=$NODEPOOL_DOCKER_REGISTRY_PROXY # export NODEPOOL_DOCKER_REGISTRY_PROXY=$NODEPOOL_DOCKER_REGISTRY_PROXY
export NODEPOOL_CENTOS_MIRROR=$NODEPOOL_CENTOS_MIRROR export NODEPOOL_CENTOS_MIRROR=$NODEPOOL_CENTOS_MIRROR
export NODEPOOL_MIRROR_HOST=mirror.mtl01.inap.openstack.org export NODEPOOL_MIRROR_HOST={{ mirror_fqdn | default('mirror.mtl01.inap.openstack.org') }}
EOF EOF
fi fi

View File

@ -7,7 +7,7 @@
# Clone https://github.com/openstack/tripleo-quickstart and run: # Clone https://github.com/openstack/tripleo-quickstart and run:
# >> ansible-playbook launcher-playbook.yaml \ # >> ansible-playbook launcher-playbook.yaml \
# -e nodepool_provider=libvirt \ # -e nodepool_provider=libvirt \
# -e mirror_path=mirror.mtl01.inap.openstack.org # -e mirror_fqdn=mirror.mtl01.inap.openstack.org
# #
# To run on a different cloud defined in clouds.yaml ( default is rdo-cloud): # To run on a different cloud defined in clouds.yaml ( default is rdo-cloud):
# >> ansible-playbook launcher-playbook.yaml \ # >> ansible-playbook launcher-playbook.yaml \
@ -53,7 +53,8 @@
clouds_yaml_path: "/home/{{ ansible_user }}/.config/openstack/clouds.yaml" clouds_yaml_path: "/home/{{ ansible_user }}/.config/openstack/clouds.yaml"
{% endraw -%} {% endraw -%}
ovb_key_name: tripleo-ci-team ovb_key_name: tripleo-ci-team
mirror_path: mirror.regionone.rdo-cloud.rdoproject.org mirror_fqdn: "{{ mirror_path | default(mirror_fqdn | default('mirror.regionone.rdo-cloud.rdoproject.org')) }}"
pypi_fqdn: "{{ pypi_fqdn | default(mirror_fqdn) }}"
launch_job_branch: {{ zuul.branch }} launch_job_branch: {{ zuul.branch }}
{% if 'periodic' not in zuul.job -%} {% if 'periodic' not in zuul.job -%}
depends_on: depends_on:
@ -94,9 +95,8 @@
baremetal_image: CentOS-7-x86_64-GenericCloud-1804_02 baremetal_image: CentOS-7-x86_64-GenericCloud-1804_02
remove_ovb_after_job: false remove_ovb_after_job: false
{% endif -%} {% endif -%}
{% raw -%} mirror_fqdn: "{{ mirror_fqdn | default('mirror.mtl01.inap.openstack.org') }}"
mirror_fqdn: {{ mirror_path }} pypi_fqdn: "{{ pypi_fqdn | default(mirror_fqdn) }}"
{% endraw -%}
{% if releases_file_output is defined -%} {% if releases_file_output is defined -%}
ready_releases_file: | ready_releases_file: |
{{ releases_file_output | replace('export', ' export') }} {{ releases_file_output | replace('export', ' export') }}

View File

@ -254,7 +254,7 @@ PATH=${HOME}/.local/bin:$PATH ansible-playbook \
# Set the options selected into EXTRA_PARAMS # Set the options selected into EXTRA_PARAMS
if [[ "$LIBVIRT" == "1" ]]; then if [[ "$LIBVIRT" == "1" ]]; then
EXTRA_PARAMS="$EXTRA_PARAMS -e nodepool_provider=libvirt " EXTRA_PARAMS="$EXTRA_PARAMS -e nodepool_provider=libvirt "
EXTRA_PARAMS="$EXTRA_PARAMS -e mirror_path=mirror.mtl01.inap.openstack.org " EXTRA_PARAMS="$EXTRA_PARAMS -e mirror_fqdn=mirror.mtl01.inap.openstack.org "
fi fi
if [[ "$LIBVIRT" == "0" && "$CLOUD_NAME" != "rdo-cloud" ]]; then if [[ "$LIBVIRT" == "0" && "$CLOUD_NAME" != "rdo-cloud" ]]; then