From: Rihab Banday Date: Mon, 17 Aug 2020 08:44:56 +0000 (+0000) Subject: Merge "Remove creation of httpboot folder" X-Git-Tag: opnfv-10.0.0~33 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=c9677cb936e57045c3a7e56c7368b27c7d09a5ad;hp=-c;p=kuberef.git Merge "Remove creation of httpboot folder" --- c9677cb936e57045c3a7e56c7368b27c7d09a5ad diff --combined functions.sh index c8493d2,b79dfa4..129a3a6 --- a/functions.sh +++ b/functions.sh @@@ -23,16 -23,7 +23,16 @@@ clean_up() # Create jumphost VM create_jump() { ./create_vm.sh "$VM_NAME" - sleep 30 + jumpbox_ip=$(get_vm_ip) + i=0 + while [ -z $jumpbox_ip ]; do + sleep $((++i)) + jumpbox_ip=$(get_vm_ip) + done + i=0 + until nc -w5 -z $jumpbox_ip 22; do + sleep $((++i)) + done } # Get jumphost VM IP @@@ -42,8 -33,7 +42,8 @@@ get_vm_ip() # Setup PXE network setup_PXE_network() { - ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << "EOF" + # shellcheck disable=SC2087 + ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF sudo ifconfig $PXE_IF up sudo ifconfig $PXE_IF $PXE_IF_IP netmask $NETMASK sudo ifconfig $PXE_IF hw ether $PXE_IF_MAC @@@ -53,23 -43,19 +53,20 @@@ EO # Copy files needed by Infra engine & BMRA in the jumphost VM copy_files_jump() { scp -r -o StrictHostKeyChecking=no \ - "$CURRENTPATH/{hw_config/$VENDOR/,sw_config/$INSTALLER/}" \ + "$CURRENTPATH"/{hw_config/"$VENDOR"/,sw_config/"$INSTALLER"/} \ "$USERNAME@$(get_vm_ip):$PROJECT_ROOT" } # Host Provisioning provision_hosts() { - ssh -tT "$USERNAME"@"$(get_vm_ip)" << "EOF" + # shellcheck disable=SC2087 + ssh -tT "$USERNAME"@"$(get_vm_ip)" << EOF # Install and run cloud-infra if [ ! -d "${PROJECT_ROOT}/engine" ]; then ssh-keygen -t rsa -N "" -f ${PROJECT_ROOT}/.ssh/id_rsa git clone https://gerrit.nordix.org/infra/engine.git cp $PROJECT_ROOT/$VENDOR/{pdf.yaml,idf.yaml} \ ${PROJECT_ROOT}/engine/engine - # NOTE: will be removed when centos image path will be added in infra-engine - sudo mkdir /httpboot - # sudo cp -r ${PROJECT_ROOT}/deployment_image.qcow2 /httpboot fi cd ${PROJECT_ROOT}/engine/engine ./deploy.sh -s ironic -d centos7 \ @@@ -80,8 -66,7 +77,8 @@@ EO # Setup networking on provisioned hosts (Adapt setup_network.sh according to your network setup) setup_network() { - ssh -tT "$USERNAME"@"$(get_vm_ip)" << "EOF" + # shellcheck disable=SC2087 + ssh -tT "$USERNAME"@"$(get_vm_ip)" << EOF ssh -o StrictHostKeyChecking=no root@$MASTER_IP \ 'bash -s' < ${PROJECT_ROOT}/${VENDOR}/setup_network.sh ssh -o StrictHostKeyChecking=no root@$WORKER_IP \ @@@ -91,8 -76,7 +88,8 @@@ EO # k8s Provisioning (currently BMRA) provision_k8s() { - ssh -tT "$USERNAME"@"$(get_vm_ip)" << "EOF" + # shellcheck disable=SC2087 + ssh -tT "$USERNAME"@"$(get_vm_ip)" << EOF # Install BMRA if [ ! -d "${PROJECT_ROOT}/container-experience-kits" ]; then curl -fsSL https://get.docker.com/ | sh