From 666c62b2625d2e84d591510756ca4e297312b8a8 Mon Sep 17 00:00:00 2001 From: Ronelle Landy Date: Wed, 13 Feb 2019 18:58:36 -0500 Subject: [PATCH] Add settings for ovb_key_name Allow users to override the default tripleo-ci-team key with the key in their local tenant. Also, remove the use of env vars for mirror_fqdn and replace with variable passing. Change-Id: I8852f9e9973567d361b01e7ea4bd297a20876351 --- .../templates/launcher-playbook.yaml.j2 | 9 ++++++--- .../reproducer-zuul-based-quickstart.sh.j2 | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/roles/create-zuul-based-reproducer/templates/launcher-playbook.yaml.j2 b/roles/create-zuul-based-reproducer/templates/launcher-playbook.yaml.j2 index b229fab16..1b415ed73 100644 --- a/roles/create-zuul-based-reproducer/templates/launcher-playbook.yaml.j2 +++ b/roles/create-zuul-based-reproducer/templates/launcher-playbook.yaml.j2 @@ -5,9 +5,9 @@ # # To run the libvirt option (available for non-OVB jobs): # Clone https://github.com/openstack/tripleo-quickstart and run: -# >> export NODEPOOL_MIRROR=mirror.mtl01.inap.openstack.org # >> ansible-playbook launcher-playbook.yaml \ -# -e nodepool_provider=libvirt +# -e nodepool_provider=libvirt \ +# -e mirror_path=mirror.mtl01.inap.openstack.org # # To run on a different cloud defined in clouds.yaml ( default is rdo-cloud): # >> ansible-playbook launcher-playbook.yaml \ @@ -52,6 +52,8 @@ {% raw -%} 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 depends_on: - {{ zuul.change_url }} zuul_yaml: >- @@ -76,6 +78,7 @@ identity_api_version: 3 user_domain_name: Default project_domain_name: Default + key_name: {{ ovb_key_name }} {% endraw -%} cloud_settings: rdocloud: @@ -88,7 +91,7 @@ remove_ovb_after_job: false {% endif -%} {% raw -%} - mirror_fqdn: {{ lookup('env', 'NODEPOOL_MIRROR') | default('mirror.regionone.rdo-cloud.rdoproject.org', true) }} + mirror_fqdn: {{ mirror_path }} {% endraw -%} {% if releases_file_output is defined -%} ready_releases_file: | 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 cd595ddc0..947bdb538 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 @@ -8,6 +8,7 @@ : ${LIBVIRT:=0} : ${CLOUD_NAME:="rdo-cloud"} : ${CLOUDS_YAML_PATH:="/home/$USER/.config/openstack/clouds.yaml"} +: ${OVB_KEY_NAME:="tripleo-ci-team"} : ${FORCE_POST_FAILURE:=0} : ${UPSTREAM_GERRIT_USER:="$USER"} : ${RDO_GERRIT_USER:="$USER"} @@ -35,6 +36,9 @@ usage () { echo " -cp, --clouds-yaml-path" echo " Full path to the clouds.yaml file" echo " Defaults to /home/$USER/.config/openstack/clouds.yaml" + echo " -ok, --ovb-key-name" + echo " Name of the key to use in the host tenant for OVB deployments" + echo " Defaults to tripleo-ci-team" echo " -f, --force-post-failure" echo " Force job to fail so that the nodes will be held." echo " Temporary solution" @@ -93,6 +97,11 @@ while [ "x$1" != "x" ]; do shift ;; + --ovb-key-name|-ok) + OVB_KEY_NAME=$2 + shift + ;; + --force-post-failure|-f) FORCE_FAILURE=1 ;; @@ -225,7 +234,7 @@ ansible-playbook \ # Set the options selected into EXTRA_PARAMS if [[ "$LIBVIRT" == "1" ]]; then EXTRA_PARAMS="$EXTRA_PARAMS -e nodepool_provider=libvirt " - export NODEPOOL_MIRROR=mirror.mtl01.inap.openstack.org + EXTRA_PARAMS="$EXTRA_PARAMS -e mirror_path=mirror.mtl01.inap.openstack.org " fi if [[ "$LIBVIRT" == "0" && "$CLOUD_NAME" != "rdo-cloud" ]]; then @@ -236,6 +245,10 @@ if [[ "$CLOUDS_YAML_PATH" != "/home/$USER/.config/openstack/clouds.yaml" ]]; the EXTRA_PARAMS="$EXTRA_PARAMS -e clouds_yaml_path=$CLOUDS_YAML_PATH " fi +if [[ "$OVB_KEY_NAME" != "tripleo-ci-team" ]]; then + EXTRA_PARAMS="$EXTRA_PARAMS -e ovb_key_name=$OVB_KEY_NAME " +fi + if [[ "$FORCE_POST_FAILURE" == "1" ]]; then EXTRA_PARAMS="$EXTRA_PARAMS -e force_post_failure=true " fi