+
+# Copy kubeconfig from Jump VM to appropriate location in Jump Host
+# Direct scp to the specified location doesn't work due to permission/ssh-keys
+ scp -o StrictHostKeyChecking=no "$USERNAME"@"$(get_vm_ip)":"${PROJECT_ROOT}"/kubeconfig kubeconfig
+ if [ -d "/home/opnfv/functest-kubernetes" ]; then
+ sudo cp kubeconfig /home/opnfv/functest-kubernetes/config
+ fi
+}
+
+# Creates a python virtual environment
+creates_virtualenv() {
+ if [ ! -d "$CURRENTPATH/.venv" ]; then
+ virtualenv .venv
+ fi
+ # shellcheck disable=SC1090
+ source "$CURRENTPATH/.venv/bin/activate"
+ pip install -r "$CURRENTPATH/requirements.txt"
+}
+
+# Executes a specific Ansible playbook
+run_playbook() {
+ ansible_cmd="$(command -v ansible-playbook) -i $CURRENTPATH/inventory/localhost.ini -e ansible_python_interpreter=$(command -v python)"
+ if [ "${DEBUG:-false}" == "true" ]; then
+ ansible_cmd+=" -vvv"
+ fi
+ eval "$ansible_cmd $CURRENTPATH/playbooks/${1}.yaml"