blob: a8bdcceeab0345426cf7c944b6cf051f8563a245 [file] [log] [blame]
Fatih Degirmencibecbba02019-02-25 00:37:19 +00001#!/bin/bash
2# ============LICENSE_START=======================================================
3# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
4# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
19
20set -o errexit
21set -o nounset
22set -o pipefail
23
24INSTALLER_ROOT_DIR="$(dirname $(realpath ${BASH_SOURCE[0]}))"
25export ANSIBLE_ROLES_PATH="$HOME/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:${ENGINE_PATH}/engine/playbooks/roles:${ENGINE_CACHE}/repos/bifrost/playbooks/roles"
26export ANSIBLE_LIBRARY="$HOME/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:${ENGINE_CACHE}/repos/bifrost/playbooks/library"
27
28# configure target hosts
29echo "-------------------------------------------------------------------------"
30echo "Info: Configure target hosts"
31echo "-------------------------------------------------------------------------"
Fatih Degirmenci7ea95f72019-04-18 13:40:17 +000032cd ${ENGINE_PATH}
Fatih Degirmencibecbba02019-02-25 00:37:19 +000033ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \
Fatih Degirmencibecbba02019-02-25 00:37:19 +000034 -i ${ENGINE_CACHE}/repos/bifrost/playbooks/inventory/bifrost_inventory.py \
Fatih Degirmenci7ea95f72019-04-18 13:40:17 +000035 ${INSTALLER_ROOT_DIR}/playbooks/configure-targethosts.yml
Fatih Degirmencibecbba02019-02-25 00:37:19 +000036
Fatih Degirmenciccc68892019-02-27 09:16:45 +000037# configure installer
38echo "-------------------------------------------------------------------------"
39echo "Info: Configure installer"
40echo "-------------------------------------------------------------------------"
Fatih Degirmenci7ea95f72019-04-18 13:40:17 +000041cd ${ENGINE_PATH}
Fatih Degirmenciccc68892019-02-27 09:16:45 +000042ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \
Fatih Degirmenci7ea95f72019-04-18 13:40:17 +000043 -i ${ENGINE_CACHE}/repos/bifrost/playbooks/inventory/bifrost_inventory.py \
44 ${INSTALLER_ROOT_DIR}/playbooks/configure-installer.yml
Fatih Degirmenciccc68892019-02-27 09:16:45 +000045
Fatih Degirmenci18c7c312019-04-09 16:44:45 +000046# bootstrap scenario
47echo "-------------------------------------------------------------------------"
48echo "Info: Bootstrap scenario"
49echo "-------------------------------------------------------------------------"
Fatih Degirmenci7ea95f72019-04-18 13:40:17 +000050cd ${ENGINE_PATH}
Fatih Degirmenci18c7c312019-04-09 16:44:45 +000051ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \
Fatih Degirmenci7ea95f72019-04-18 13:40:17 +000052 -i ${ENGINE_CACHE}/repos/bifrost/playbooks/inventory/bifrost_inventory.py \
53 ${INSTALLER_ROOT_DIR}/playbooks/bootstrap-scenario.yml
Fatih Degirmenci18c7c312019-04-09 16:44:45 +000054
Fatih Degirmenci58120462019-02-27 14:29:45 +000055# install Kubernetes scenario
56echo "-------------------------------------------------------------------------"
57echo "Info: Install Kubernetes Scenario"
58echo "-------------------------------------------------------------------------"
59cd ${ENGINE_CACHE}/repos/kubespray
60ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \
61 --ssh-extra-args='-o StrictHostKeyChecking=no' \
62 --user root \
Yantian You09d30492019-05-22 20:35:44 +020063 -e "http_proxy=${http_proxy:-}" \
64 -e "https_proxy=${https_proxy:-}" \
65 -e "additional_no_proxy=${no_proxy:-}" \
Fatih Degirmenci58120462019-02-27 14:29:45 +000066 -i inventory/engine/bifrost_inventory.py \
67 cluster.yml
68
Fatih Degirmencie7995082019-03-24 20:49:21 +000069# run post-deployment tasks
70echo "-------------------------------------------------------------------------"
71echo "Info: Running post deployment tasks"
72echo "-------------------------------------------------------------------------"
Fatih Degirmenci7ea95f72019-04-18 13:40:17 +000073cd ${ENGINE_PATH}
Fatih Degirmencie7995082019-03-24 20:49:21 +000074ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \
Fatih Degirmencie7995082019-03-24 20:49:21 +000075 -i ${ENGINE_CACHE}/repos/kubespray/inventory/engine/bifrost_inventory.py \
Fatih Degirmenci7ea95f72019-04-18 13:40:17 +000076 ${INSTALLER_ROOT_DIR}/playbooks/post-deployment.yml
Fatih Degirmencie7995082019-03-24 20:49:21 +000077
Fatih Degirmencibecbba02019-02-25 00:37:19 +000078# vim: set ts=2 sw=2 expandtab: