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 | 3646fcd | 2019-06-12 16:21:11 +0200 | [diff] [blame] | 34 | -i ${ENGINE_CACHE}/config/inventory.ini \ |
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 | 3646fcd | 2019-06-12 16:21:11 +0200 | [diff] [blame] | 43 | -i ${ENGINE_CACHE}/config/inventory.ini \ |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 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 "-------------------------------------------------------------------------" |
Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame^] | 48 | echo "Info: Execute scenario pre deployment tasks" |
Fatih Degirmenci | 18c7c31 | 2019-04-09 16:44:45 +0000 | [diff] [blame] | 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 | 3646fcd | 2019-06-12 16:21:11 +0200 | [diff] [blame] | 52 | -i ${ENGINE_CACHE}/config/inventory.ini \ |
Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame^] | 53 | ${INSTALLER_ROOT_DIR}/playbooks/pre-deployment.yml |
Fatih Degirmenci | 18c7c31 | 2019-04-09 16:44:45 +0000 | [diff] [blame] | 54 | |
Fatih Degirmenci | 3646fcd | 2019-06-12 16:21:11 +0200 | [diff] [blame] | 55 | # install scenario |
Fatih Degirmenci | 5812046 | 2019-02-27 14:29:45 +0000 | [diff] [blame] | 56 | echo "-------------------------------------------------------------------------" |
Fatih Degirmenci | 3646fcd | 2019-06-12 16:21:11 +0200 | [diff] [blame] | 57 | echo "Info: Install scenario ${DEPLOY_SCENARIO}" |
Fatih Degirmenci | 5812046 | 2019-02-27 14:29:45 +0000 | [diff] [blame] | 58 | echo "-------------------------------------------------------------------------" |
| 59 | cd ${ENGINE_CACHE}/repos/kubespray |
| 60 | ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \ |
Yantian You | 09d3049 | 2019-05-22 20:35:44 +0200 | [diff] [blame] | 61 | -e "http_proxy=${http_proxy:-}" \ |
| 62 | -e "https_proxy=${https_proxy:-}" \ |
| 63 | -e "additional_no_proxy=${no_proxy:-}" \ |
Fatih Degirmenci | 3646fcd | 2019-06-12 16:21:11 +0200 | [diff] [blame] | 64 | -i inventory/engine/inventory.ini \ |
Fatih Degirmenci | 5812046 | 2019-02-27 14:29:45 +0000 | [diff] [blame] | 65 | cluster.yml |
| 66 | |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 67 | # run post-deployment tasks |
| 68 | echo "-------------------------------------------------------------------------" |
Fatih Degirmenci | 73175db | 2019-07-16 07:49:01 +0000 | [diff] [blame^] | 69 | echo "Info: Execute scenario and common post deployment tasks" |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 70 | echo "-------------------------------------------------------------------------" |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 71 | cd ${ENGINE_PATH} |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 72 | ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \ |
Fatih Degirmenci | 3646fcd | 2019-06-12 16:21:11 +0200 | [diff] [blame] | 73 | -i ${ENGINE_CACHE}/config/inventory.ini \ |
Fatih Degirmenci | 7ea95f7 | 2019-04-18 13:40:17 +0000 | [diff] [blame] | 74 | ${INSTALLER_ROOT_DIR}/playbooks/post-deployment.yml |
Fatih Degirmenci | e799508 | 2019-03-24 20:49:21 +0000 | [diff] [blame] | 75 | |
Fatih Degirmenci | becbba0 | 2019-02-25 00:37:19 +0000 | [diff] [blame] | 76 | # vim: set ts=2 sw=2 expandtab: |