From 849e2fe485f846d1d25d9da521a887d8bc88ceda Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 27 Nov 2019 10:34:15 +0100 Subject: [PATCH] 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 --- .../templates/reproducer-quickstart.sh.j2 | 2 +- .../templates/launcher-playbook.yaml.j2 | 10 +++++----- .../templates/reproducer-zuul-based-quickstart.sh.j2 | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 b/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 index afe18298a..d71ace477 100644 --- a/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 +++ b/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 @@ -368,7 +368,7 @@ cat >>"{{ env_vars_to_source_file }}" <> ansible-playbook launcher-playbook.yaml \ # -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): # >> ansible-playbook launcher-playbook.yaml \ @@ -53,7 +53,8 @@ clouds_yaml_path: "/home/{{ ansible_user }}/.config/openstack/clouds.yaml" {% endraw -%} 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 }} {% if 'periodic' not in zuul.job -%} depends_on: @@ -94,9 +95,8 @@ baremetal_image: CentOS-7-x86_64-GenericCloud-1804_02 remove_ovb_after_job: false {% endif -%} - {% raw -%} - mirror_fqdn: {{ mirror_path }} - {% endraw -%} + mirror_fqdn: "{{ mirror_fqdn | default('mirror.mtl01.inap.openstack.org') }}" + pypi_fqdn: "{{ pypi_fqdn | default(mirror_fqdn) }}" {% if releases_file_output is defined -%} ready_releases_file: | {{ releases_file_output | replace('export', ' export') }} diff --git a/roles/create-zuul-based-reproducer/templates/reproducer-zuul-based-quickstart.sh.j2 b/roles/create-zuul-based-reproducer/templates/reproducer-zuul-based-quickstart.sh.j2 index cdb9dc613..723b01665 100644 --- a/roles/create-zuul-based-reproducer/templates/reproducer-zuul-based-quickstart.sh.j2 +++ b/roles/create-zuul-based-reproducer/templates/reproducer-zuul-based-quickstart.sh.j2 @@ -254,7 +254,7 @@ PATH=${HOME}/.local/bin:$PATH ansible-playbook \ # Set the options selected into EXTRA_PARAMS if [[ "$LIBVIRT" == "1" ]]; then 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 if [[ "$LIBVIRT" == "0" && "$CLOUD_NAME" != "rdo-cloud" ]]; then