From a6f9b941aedbaea251b6b861bdb8cd733408cbe2 Mon Sep 17 00:00:00 2001 From: Raul Sevilla Date: Mon, 23 Dec 2024 12:58:26 +0100 Subject: [PATCH 1/3] Tweak path to fetch SNO kubeconfig Signed-off-by: Raul Sevilla --- .../deploy/openshift-qe-installer-bm-deploy-commands.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh b/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh index 1990358e915c..2d912f362d0c 100644 --- a/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh +++ b/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh @@ -13,6 +13,7 @@ CRUCIBLE_URL=$(cat "/secret/crucible_url") JETLAG_PR=${JETLAG_PR:-} REPO_NAME=${REPO_NAME:-} PULL_NUMBER=${PULL_NUMBER:-} +KUBECONFIG_SRC="" cat <>/tmp/all.yml --- @@ -164,7 +165,12 @@ ssh ${SSH_ARGS} root@${bastion} " ansible-playbook -i ansible/inventory/$LAB_CLOUD.local ansible/setup-bastion.yml | tee /tmp/ansible-setup-bastion-$(date +%s) ansible-playbook -i ansible/inventory/$LAB_CLOUD.local ansible/${TYPE}-deploy.yml -v | tee /tmp/ansible-${TYPE}-deploy-$(date +%s) mkdir -p /root/$LAB/$LAB_CLOUD/$TYPE - ansible -i ansible/inventory/$LAB_CLOUD.local bastion -m fetch -a 'src=/root/${TYPE}/kubeconfig dest=/root/$LAB/$LAB_CLOUD/$TYPE/kubeconfig flat=true' + if [[ ${TYPE} == 'sno' ]]; then + KUBECONFIG_SRC='/root/sno/{{ groups.sno[0] }}' + else + KUBECONFIG_SRC=/root/${TYPE}/kubeconfig + fi + ansible -i ansible/inventory/$LAB_CLOUD.local bastion -m fetch -a 'src=${KUBECONFIG_SRC} dest=/root/$LAB/$LAB_CLOUD/$TYPE/kubeconfig flat=true' deactivate rm -rf .ansible " From 588497366c1224e6fb713525737afa1aff989aed Mon Sep 17 00:00:00 2001 From: Raul Sevilla Date: Tue, 24 Dec 2024 10:16:50 +0100 Subject: [PATCH 2/3] Add missing kubeconfig suffix Signed-off-by: Raul Sevilla --- .../bm/deploy/openshift-qe-installer-bm-deploy-commands.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh b/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh index 2d912f362d0c..3bcd2259d4bc 100644 --- a/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh +++ b/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh @@ -166,7 +166,7 @@ ssh ${SSH_ARGS} root@${bastion} " ansible-playbook -i ansible/inventory/$LAB_CLOUD.local ansible/${TYPE}-deploy.yml -v | tee /tmp/ansible-${TYPE}-deploy-$(date +%s) mkdir -p /root/$LAB/$LAB_CLOUD/$TYPE if [[ ${TYPE} == 'sno' ]]; then - KUBECONFIG_SRC='/root/sno/{{ groups.sno[0] }}' + KUBECONFIG_SRC='/root/sno/{{ groups.sno[0] }}/kubeconfig' else KUBECONFIG_SRC=/root/${TYPE}/kubeconfig fi From 964ceb2a5bec36ef0263332c76c46a4524ca16a1 Mon Sep 17 00:00:00 2001 From: Raul Sevilla Date: Tue, 24 Dec 2024 11:43:54 +0100 Subject: [PATCH 3/3] Move conditional outside ssh command Signed-off-by: Raul Sevilla --- .../openshift-qe-installer-bm-deploy-commands.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh b/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh index 3bcd2259d4bc..2506a17c7bb5 100644 --- a/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh +++ b/ci-operator/step-registry/openshift-qe/installer/bm/deploy/openshift-qe-installer-bm-deploy-commands.sh @@ -154,6 +154,12 @@ scp -q ${SSH_ARGS} /secret/pull_secret root@${bastion}:${jetlag_repo}/pull_secre scp -q ${SSH_ARGS} /tmp/clean-resources.sh root@${bastion}:/tmp/ scp -q ${SSH_ARGS} /tmp/prereqs-updated.sh root@${bastion}:/tmp/ +if [[ ${TYPE} == 'sno' ]]; then + KUBECONFIG_SRC='/root/sno/{{ groups.sno[0] }}/kubeconfig' +else + KUBECONFIG_SRC=/root/${TYPE}/kubeconfig +fi + ssh ${SSH_ARGS} root@${bastion} " set -e set -o pipefail @@ -165,11 +171,6 @@ ssh ${SSH_ARGS} root@${bastion} " ansible-playbook -i ansible/inventory/$LAB_CLOUD.local ansible/setup-bastion.yml | tee /tmp/ansible-setup-bastion-$(date +%s) ansible-playbook -i ansible/inventory/$LAB_CLOUD.local ansible/${TYPE}-deploy.yml -v | tee /tmp/ansible-${TYPE}-deploy-$(date +%s) mkdir -p /root/$LAB/$LAB_CLOUD/$TYPE - if [[ ${TYPE} == 'sno' ]]; then - KUBECONFIG_SRC='/root/sno/{{ groups.sno[0] }}/kubeconfig' - else - KUBECONFIG_SRC=/root/${TYPE}/kubeconfig - fi ansible -i ansible/inventory/$LAB_CLOUD.local bastion -m fetch -a 'src=${KUBECONFIG_SRC} dest=/root/$LAB/$LAB_CLOUD/$TYPE/kubeconfig flat=true' deactivate rm -rf .ansible