blob: 922c7ccb6155a655e7f00a553e5b7621de74b5dd [file] [log] [blame]
Gary Wu14a6b302018-05-01 15:59:28 -07001#!/bin/bash
2
3NUM_K8S_VMS=7
4
5if [ -z "$WORKSPACE" ]; then
6 export WORKSPACE=`git rev-parse --show-toplevel`
7fi
8PARTS_DIR=$WORKSPACE/deployment/heat/onap-oom/parts
9
Gary Wu11c98742018-05-02 16:19:04 -070010cat <<EOF
11#
12# Generated by scripts/gen-onap-oom-yaml.sh; MANUAL CHANGES WILL BE LOST
13#
14EOF
15
Gary Wu14a6b302018-05-01 15:59:28 -070016cat $PARTS_DIR/onap-oom-1.yaml
17
18cat <<EOF
19 rancher_vm:
20 type: OS::Nova::Server
21 properties:
22 name: rancher
23 image: { get_param: ubuntu_1604_image }
24 flavor: { get_param: rancher_vm_flavor }
25 key_name: onap_key
26 networks:
27 - port: { get_resource: rancher_private_port }
28 user_data_format: RAW
29 user_data:
30 str_replace:
31 template:
32 get_file: rancher_vm_entrypoint.sh
33 params:
Gary Wu14a6b302018-05-01 15:59:28 -070034 __docker_proxy__: { get_param: docker_proxy }
35 __apt_proxy__: { get_param: apt_proxy }
36 __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
Gary Wu11c98742018-05-02 16:19:04 -070037 __integration_override_yaml__: { get_param: integration_override_yaml }
38 __oam_network_id__: { get_resource: oam_network }
39 __oam_subnet_id__: { get_resource: oam_subnet }
Gary Wu14a6b302018-05-01 15:59:28 -070040 __k8s_vm_ips__: [
41EOF
42
43for VM_NUM in $(seq $NUM_K8S_VMS); do
44 K8S_VM_NAME=k8s_$VM_NUM
45 cat <<EOF
46 get_attr: [${K8S_VM_NAME}_floating_ip, floating_ip_address],
47EOF
48done
49
50cat <<EOF
51 ]
52EOF
53
54for VM_NUM in $(seq $NUM_K8S_VMS); do
55 K8S_VM_NAME=k8s_$VM_NUM envsubst < $PARTS_DIR/onap-oom-2.yaml
56done
57
58cat $PARTS_DIR/onap-oom-3.yaml