Fatih Degirmenci | becbba0 | 2019-02-25 00:37:19 +0000 | [diff] [blame] | 1 | #!/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 | |
| 20 | set -o errexit |
| 21 | set -o nounset |
| 22 | set -o pipefail |
| 23 | |
| 24 | INSTALLER_ROOT_DIR="$(dirname $(realpath ${BASH_SOURCE[0]}))" |
| 25 | export ANSIBLE_ROLES_PATH="$HOME/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:${ENGINE_PATH}/engine/playbooks/roles:${ENGINE_CACHE}/repos/bifrost/playbooks/roles" |
| 26 | export ANSIBLE_LIBRARY="$HOME/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:${ENGINE_CACHE}/repos/bifrost/playbooks/library" |
| 27 | |
| 28 | # configure target hosts |
| 29 | echo "-------------------------------------------------------------------------" |
| 30 | echo "Info: Configure target hosts" |
| 31 | echo "-------------------------------------------------------------------------" |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 32 | cd ${ENGINE_PATH} |
Fatih Degirmenci | becbba0 | 2019-02-25 00:37:19 +0000 | [diff] [blame] | 33 | ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \ |
Fatih Degirmenci | becbba0 | 2019-02-25 00:37:19 +0000 | [diff] [blame] | 34 | -i ${ENGINE_CACHE}/repos/bifrost/playbooks/inventory/bifrost_inventory.py \ |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 35 | ${INSTALLER_ROOT_DIR}/playbooks/configure-targethosts.yml |
Fatih Degirmenci | becbba0 | 2019-02-25 00:37:19 +0000 | [diff] [blame] | 36 | |
Fatih Degirmenci | ccc6889 | 2019-02-27 09:16:45 +0000 | [diff] [blame] | 37 | # configure installer |
| 38 | echo "-------------------------------------------------------------------------" |
| 39 | echo "Info: Configure installer" |
| 40 | echo "-------------------------------------------------------------------------" |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 41 | cd ${ENGINE_PATH} |
Fatih Degirmenci | ccc6889 | 2019-02-27 09:16:45 +0000 | [diff] [blame] | 42 | ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \ |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 43 | -i ${ENGINE_CACHE}/repos/bifrost/playbooks/inventory/bifrost_inventory.py \ |
| 44 | ${INSTALLER_ROOT_DIR}/playbooks/configure-installer.yml |
Fatih Degirmenci | ccc6889 | 2019-02-27 09:16:45 +0000 | [diff] [blame] | 45 | |
Fatih Degirmenci | 18c7c31 | 2019-04-09 16:44:45 +0000 | [diff] [blame] | 46 | # bootstrap scenario |
| 47 | echo "-------------------------------------------------------------------------" |
| 48 | echo "Info: Bootstrap scenario" |
| 49 | echo "-------------------------------------------------------------------------" |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 50 | cd ${ENGINE_PATH} |
Fatih Degirmenci | 18c7c31 | 2019-04-09 16:44:45 +0000 | [diff] [blame] | 51 | ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \ |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 52 | -i ${ENGINE_CACHE}/repos/bifrost/playbooks/inventory/bifrost_inventory.py \ |
| 53 | ${INSTALLER_ROOT_DIR}/playbooks/bootstrap-scenario.yml |
Fatih Degirmenci | 18c7c31 | 2019-04-09 16:44:45 +0000 | [diff] [blame] | 54 | |
Fatih Degirmenci | 5812046 | 2019-02-27 14:29:45 +0000 | [diff] [blame] | 55 | # install Kubernetes scenario |
| 56 | echo "-------------------------------------------------------------------------" |
| 57 | echo "Info: Install Kubernetes Scenario" |
| 58 | echo "-------------------------------------------------------------------------" |
| 59 | cd ${ENGINE_CACHE}/repos/kubespray |
| 60 | ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \ |
| 61 | --ssh-extra-args='-o StrictHostKeyChecking=no' \ |
| 62 | --user root \ |
| 63 | -i inventory/engine/bifrost_inventory.py \ |
| 64 | cluster.yml |
| 65 | |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 66 | # run post-deployment tasks |
| 67 | echo "-------------------------------------------------------------------------" |
| 68 | echo "Info: Running post deployment tasks" |
| 69 | echo "-------------------------------------------------------------------------" |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 70 | cd ${ENGINE_PATH} |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 71 | ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \ |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 72 | -i ${ENGINE_CACHE}/repos/kubespray/inventory/engine/bifrost_inventory.py \ |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 73 | ${INSTALLER_ROOT_DIR}/playbooks/post-deployment.yml |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 74 | |
Fatih Degirmenci | becbba0 | 2019-02-25 00:37:19 +0000 | [diff] [blame] | 75 | # vim: set ts=2 sw=2 expandtab: |