| #!/bin/bash |
| |
| ################################################################################ |
| # Copyright (c) 2019 AT&T Intellectual Property. # |
| # Copyright (c) 2019 Nokia. # |
| # # |
| # Licensed under the Apache License, Version 2.0 (the "License"); # |
| # you may not use this file except in compliance with the License. # |
| # You may obtain a copy of the License at # |
| # # |
| # http://www.apache.org/licenses/LICENSE-2.0 # |
| # # |
| # Unless required by applicable law or agreed to in writing, software # |
| # distributed under the License is distributed on an "AS IS" BASIS, # |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # |
| # See the License for the specific language governing permissions and # |
| # limitations under the License. # |
| ################################################################################ |
| |
| |
| # 1. Edit the ../etc/env.rc file for local deployment's Gerrit, Nexus repos, Helm repo |
| # parameters |
| # 2. Update the ../etc/openstack.rc file for OpenStack installation parameters |
| # 3. Running from an environment with OpenStackl CLI access |
| |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" |
| set -a |
| RCS="$(find $DIR/../etc -type f -maxdepth 1)" |
| for RC in $RCS; do |
| echo "reading in values in $RC" |
| source $RC |
| done |
| set +a |
| |
| if [ -z "$WORKSPACE" ]; then |
| export WORKSPACE=`git rev-parse --show-toplevel` |
| fi |
| HEAT_DIR="$WORKSPACE/tools/k8s/heat" |
| BIN_DIR="$WORKSPACE/tools/k8s/bin" |
| |
| |
| stackname=aux |
| |
| for stackname in ric aux; do |
| WORKDIR_NAME="WORKDIR_${stackname}" |
| WORKDIR="${BIN_DIR}/${WORKDIR_NAME}" |
| echo ./deploy-stack.sh -w "$WORKDIR_NAME" -s "$stackname" -n 2 -6 "../heat/env/${stackname}.env" ${SSH_KEY} |
| done |
| |
| exit |
| # set up cross cluster hostname resolution for well-known host names |
| RIC_MST_IP=$(head -1 ${WORKDIR}/ips-ric | cut -f2 -d' ') |
| AUX_MST_IP=$(head -1 ${WORKDIR}/ips-aux | cut -f2 -d' ') |
| for IP in $(cut -f2 -d ' ' ips-ric); do |
| REMOTE_CMD="sudo sh -c \"echo '"$AUX_MST_IP" ves.aux.local' >> /etc/hosts; \ |
| echo '"$AUX_MST_IP" es.aux.local' >> /etc/hosts\"" |
| ssh -i $SSH_KEY -q -o "StrictHostKeyChecking no" ubuntu@$IP "$REMOTE_CMD" |
| done |
| for IP in $(cut -f2 -d ' ' ips-aux); do |
| REMOTE_CMD="sudo sh -c \"echo '"$RIC_MST_IP" a1.aux.local' >> /etc/hosts\"" |
| ssh -i $SSH_KEY -q -o "StrictHostKeyChecking no" ubuntu@$IP "$REMOTE_CMD" |
| done |
| |