From cb70a29435e04437b845d8b6205cc504e241e049 Mon Sep 17 00:00:00 2001 From: Todd Malsbary Date: Thu, 13 May 2021 16:20:06 -0700 Subject: [PATCH] Do not use hardcoded kubespray version The installed version is available in kud-vars.yml. Read the value from there before running the reset playbook. Issue-ID: ICN-525 Signed-off-by: Todd Malsbary Change-Id: I13f6f54ac3794d2a7ee9e7329c4f81305abf8ebe --- ci/jjb/shell/bluval-postbuild.sh | 3 ++- deploy/kud/kud_bm_launch.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ci/jjb/shell/bluval-postbuild.sh b/ci/jjb/shell/bluval-postbuild.sh index 622ad7a..3647687 100644 --- a/ci/jjb/shell/bluval-postbuild.sh +++ b/ci/jjb/shell/bluval-postbuild.sh @@ -5,7 +5,8 @@ set -o pipefail echo "[ICN] Uninstalling EMCO k8s" cd k8s/kud/hosting_providers/vagrant -ansible-playbook -i inventory/hosts.ini /opt/kubespray-2.12.6/reset.yml --become --become-user=root -e reset_confirmation=yes +version=$(grep "kubespray_version" ../../deployment_infra/playbooks/kud-vars.yml | awk -F ': ' '{print $2}') +ansible-playbook -i inventory/hosts.ini /opt/kubespray-${version}/reset.yml --become --become-user=root -e reset_confirmation=yes echo "[ICN] Purging Docker fully" cat << EOF | tee purge-docker.yml diff --git a/deploy/kud/kud_bm_launch.sh b/deploy/kud/kud_bm_launch.sh index 82785fa..6a0ec18 100755 --- a/deploy/kud/kud_bm_launch.sh +++ b/deploy/kud/kud_bm_launch.sh @@ -108,12 +108,13 @@ function kud_install { function kud_reset { pushd $DOWNLOAD_PATH/multicloud-k8s/kud/hosting_providers/vagrant/ - ansible-playbook -i inventory/hosts.ini /opt/kubespray-2.10.4/reset.yml \ + local version=$(grep "kubespray_version" ../../deployment_infra/playbooks/kud-vars.yml | + awk -F ': ' '{print $2}') + ansible-playbook -i inventory/hosts.ini /opt/kubespray-${version}/reset.yml \ --become --become-user=root -e reset_confirmation=yes popd } - function verifier { APISERVER=$(kubectl config view --minify -o \ jsonpath='{.clusters[0].cluster.server}') -- 2.16.6