X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-infra%2F00-Kubernetes%2Fbin%2Fgen-ric-heat-yaml.sh;fp=ric-infra%2F00-Kubernetes%2Fbin%2Fgen-ric-heat-yaml.sh;h=e32d2e7b3aebbe020a08ce3a939ec1f2352ffb95;hb=ea83d035d863452d738abca47b966defb9a35456;hp=0000000000000000000000000000000000000000;hpb=7f1e409379856025977fc8a6ea04ddb215f21a13;p=it%2Fdep.git diff --git a/ric-infra/00-Kubernetes/bin/gen-ric-heat-yaml.sh b/ric-infra/00-Kubernetes/bin/gen-ric-heat-yaml.sh new file mode 100755 index 00000000..e32d2e7b --- /dev/null +++ b/ric-infra/00-Kubernetes/bin/gen-ric-heat-yaml.sh @@ -0,0 +1,91 @@ +#!/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. # +################################################################################ + + +usage() { + echo "Usage: $0 [ -n ][ -6 ]" 1>&2; + + echo "n: Set the number of VMs that will be installed. This number must be between 1 and 99; " 1>&2; + echo "6: When set, VMs will be configured with an IPv6 interface" 1>&2; + exit 1; +} + +unset V6 +while getopts ":n:6" o; do + case "${o}" in + n) + if [[ ${OPTARG} =~ ^[0-9]+$ ]];then + if [ ${OPTARG} -ge 1 -a ${OPTARG} -le 15 ]; then + vm_num=${OPTARG} + else + usage + fi + else + usage + fi + ;; + 6) + V6='-v6' + ;; + *) + usage + ;; + esac +done +shift $((OPTIND-1)) + +NUM_K8S_VMS=$(($vm_num - 1)) +unset SEQ +if [ "$NUM_K8S_VMS" -gt "0" ]; then + SEQ=$(seq -f %02g $NUM_K8S_VMS) +fi + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi +PARTS_DIR=$WORKSPACE/ric-infra/00-Kubernetes/heat/parts + +cat <