#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
-# Copyright (c)
+# 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
# Please refer to README for detailed information.
# Get path information
-DIRECTORY=$(readlink -f $0)
-CURRENTPATH=$(dirname $DIRECTORY)
+CURRENTPATH=$(git rev-parse --show-toplevel)
+export CURRENTPATH
-# Source env variables & functions
-source $CURRENTPATH/deploy.env
-source $CURRENTPATH/functions.sh
+# shellcheck source=./functions.sh
+source "$CURRENTPATH/functions.sh"
-# Clean up leftovers
-clean_up
+# ---------------------------------------------------------------------
+# check installation and runtime prerequisites
+# ---------------------------------------------------------------------
+check_prerequisites
-# The next two functions require that you know your pxe network configuration
-# and IP of resulting jumphost VM in advance. This IP/MAC info also then needs to
-# be added in PDF & IDF files (not supported yet via this script)
-# Create jumphost VM & setup PXE network
-create_jump
-setup_PXE_network
+# shellcheck source=./deploy.env
+source "$CURRENTPATH/deploy.env"
-# Get IP of the jumphost VM
-get_vm_ip
+# ---------------------------------------------------------------------
+# bootstrap install prerequisites
+# ---------------------------------------------------------------------
+run_playbook bootstrap
+# ---------------------------------------------------------------------
+# Create jump VM from which the installation is performed
+# ---------------------------------------------------------------------
+run_playbook jump-vm
+
+# ---------------------------------------------------------------------
+# Create BMRA config based on IDF and PDF
+# ---------------------------------------------------------------------
+run_playbook bmra-config
+
+# ---------------------------------------------------------------------
# Copy files needed by Infra engine & BMRA in the jumphost VM
+# ---------------------------------------------------------------------
copy_files_jump
+# ---------------------------------------------------------------------
# Provision remote hosts
+# ---------------------------------------------------------------------
provision_hosts
+# ---------------------------------------------------------------------
# Setup networking (Adapt according to your network setup)
+# ---------------------------------------------------------------------
setup_network
+# ---------------------------------------------------------------------
# Provision k8s cluster (currently BMRA)
+# ---------------------------------------------------------------------
provision_k8s