Add initial config to support deployments on VMs
[kuberef.git] / dev / deploy_on_vms.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) Ericsson AB and others
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 # Script for end to end RI-2 deployment using Infra engine and BMRA on VMS
12 # TODO Update README
13
14 set -o errexit
15 set -o nounset
16 if [ "${DEBUG:-false}" == "true" ]; then
17     set -o xtrace
18 fi
19
20 # Get path information
21 CURRENTPATH=$(git rev-parse --show-toplevel)
22 export CURRENTPATH
23
24 # shellcheck source=./functions.sh
25 source "$CURRENTPATH/functions.sh"
26 # shellcheck source=./deploy.env
27 source "$CURRENTPATH/deploy.env"
28
29 # ---------------------------------------------------------------------
30 # check installation and runtime prerequisites
31 # ---------------------------------------------------------------------
32 check_prerequisites
33
34 # ---------------------------------------------------------------------
35 # creates a virtual environment for installation of dependencies
36 # ---------------------------------------------------------------------
37 creates_virtualenv
38
39 # ---------------------------------------------------------------------
40 # bootstrap install prerequisites
41 # ---------------------------------------------------------------------
42 run_playbook bootstrap
43
44 # ---------------------------------------------------------------------
45 # Create BMRA config based on IDF and PDF
46 # ---------------------------------------------------------------------
47 run_playbook bmra-config
48
49 # ---------------------------------------------------------------------
50 # Provision VMs
51 # ---------------------------------------------------------------------
52 provision_hosts_vms
53
54 # ---------------------------------------------------------------------
55 # Configure Networking on the VMs
56 # ---------------------------------------------------------------------
57 ansible-playbook -i "$CURRENTPATH"/engine/engine/inventory/inventory.ini "$CURRENTPATH"/playbooks/configure-vms.yaml
58
59 # ---------------------------------------------------------------------
60 # Provision k8s cluster (currently BMRA)
61 # ---------------------------------------------------------------------
62 provision_k8s_vms