Fix jinja2 rendering issue
[kuberef.git] / functions.sh
index c8968a3..4265dca 100755 (executable)
@@ -1,12 +1,8 @@
 #!/bin/bash
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) Ericsson AB and others
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
+
+# SPDX-FileCopyrightText: 2021 Ericsson AB and others
+#
+# SPDX-License-Identifier: Apache-2.0
 
 info() {
     _print_msg "INFO" "$1"
@@ -161,6 +157,7 @@ get_vm_ip() {
 # Copy files needed by Infra engine & BMRA in the jumphost VM
 copy_files_jump() {
     vm_ip="$(get_vm_ip)"
+    docker_config="/opt/kuberef/docker_config"
     scp -r -o StrictHostKeyChecking=no \
     "$CURRENTPATH"/{hw_config/"$VENDOR"/,sw_config/"$INSTALLER"/} \
     "$USERNAME@${vm_ip}:$PROJECT_ROOT"
@@ -169,6 +166,10 @@ copy_files_jump() {
         ~/.ssh/id_rsa \
         "$USERNAME@${vm_ip}:.ssh/id_rsa"
     fi
+    if [ -f "$docker_config" ]; then
+        scp -r -o StrictHostKeyChecking=no \
+        "$docker_config" "$USERNAME@${vm_ip}:$PROJECT_ROOT"
+    fi
 }
 
 # Host Provisioning
@@ -229,6 +230,14 @@ if [ ! -d "${PROJECT_ROOT}/container-experience-kits" ]; then
     git clone --recurse-submodules --depth 1 https://github.com/intel/container-experience-kits.git -b v21.03 ${PROJECT_ROOT}/container-experience-kits/
     cp -r ${PROJECT_ROOT}/container-experience-kits/examples/${BMRA_PROFILE}/group_vars ${PROJECT_ROOT}/container-experience-kits/
 fi
+if [ -f "${PROJECT_ROOT}/docker_config" ]; then
+    cp ${PROJECT_ROOT}/docker_config \
+        ${PROJECT_ROOT}/${INSTALLER}/dockerhub_credentials/vars/main.yml
+    cp -r ${PROJECT_ROOT}/${INSTALLER}/dockerhub_credentials \
+        ${PROJECT_ROOT}/container-experience-kits/roles/
+    cp ${PROJECT_ROOT}/${INSTALLER}/patched_k8s.yml \
+        ${PROJECT_ROOT}/container-experience-kits/playbooks/k8s/k8s.yml
+fi
 cp ${PROJECT_ROOT}/${INSTALLER}/{inventory.ini,ansible.cfg} \
     ${PROJECT_ROOT}/container-experience-kits/
 cp ${PROJECT_ROOT}/${INSTALLER}/{all.yml,kube-node.yml} \
@@ -241,6 +250,8 @@ cp ${PROJECT_ROOT}/${INSTALLER}/patched_rhel_packages.yml \
     ${PROJECT_ROOT}/container-experience-kits/roles/bootstrap/install_packages/tasks/rhel.yml
 cp ${PROJECT_ROOT}/${INSTALLER}/patched_packages.yml \
     ${PROJECT_ROOT}/container-experience-kits/roles/bootstrap/install_packages/tasks/main.yml
+cp ${PROJECT_ROOT}/${INSTALLER}/patched_kubespray_requirements.txt \
+    ${PROJECT_ROOT}/container-experience-kits/playbooks/k8s/kubespray/requirements.txt
 
 sudo docker run --rm \
 -e ANSIBLE_CONFIG=/bmra/ansible.cfg \