2 # Copyright 2019 AT&T Intellectual Property. All rights reserved.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 INTEGRATION_TEMPLATE=$4
22 if [ "$OPENSTACK_RC" == "" ]
24 echo "No OPENSTACK_RC file"
25 echo "Usage: create-robot-config.sh <openstack.rc> <openstack_env_param>"
28 if [ "$OPENSTACK_PARAM" == "" ]
30 echo "No OPENSTACK_PARAM"
31 echo "Usage: create-robot-config.sh <openstack.rc> <openstack_env_param>"
36 source $OPENSTACK_PARAM
40 SO_ENCRYPTION_KEY=aa3871669d893c7fb8abbcda31b88b4f
41 export OS_PASSWORD_ENCRYPTED_FOR_ROBOT=$(echo -n "$OS_PASSWORD" | openssl aes-128-ecb -e -K "$SO_ENCRYPTION_KEY" -nosalt | xxd -c 256 -p)
43 #Use new encryption method
46 cd $BUILD_DIR/integration/deployment/heat/onap-rke/scripts
48 SO_ENCRYPTION_KEY=aa3871669d893c7fb8abbcda31b88b4f
49 export OS_PASSWORD_ENCRYPTED=$(java Crypto "$OS_PASSWORD" "$SO_ENCRYPTION_KEY")
51 cp $INTEGRATION_TEMPLATE ./integration-override.yaml
52 template="integration-override.yaml"
53 sed -ir -e "s/\${OS_PASSWORD_ENCRYPTED_FOR_ROBOT}/$OS_PASSWORD_ENCRYPTED_FOR_ROBOT/" $template
54 sed -ir -e "s/\${OS_PASSWORD_ENCRYPTED}/$OS_PASSWORD_ENCRYPTED/" $template
56 sed -ir -e "s/\${OS_PROJECT_ID}/$OS_PROJECT_ID/" $template
57 sed -ir -e "s/\${OS_USERNAME}/$OS_USERNAME/" $template
58 sed -ir -e "s/\${OS_USER_DOMAIN_NAME}/$OS_USER_DOMAIN_NAME/" $template
59 sed -ir -e "s/\${OS_PROJECT_NAME}/$OS_PROJECT_NAME/" $template
60 sed -ir -e "s/\${OS_USERNAME}/$OS_USERNAME/" $template
61 sed -ir -e "s~\${OS_AUTH_URL}~$OS_AUTH_URL~" $template
64 sed -ir -e "s/__docker_proxy__/$DOCKER_REPOSITORY/" $template
65 sed -ir -e "s/__public_net_id__/$OS_PUBLIC_NETWORK_ID/" $template
66 sed -ir -e "s~__oam_network_cidr__~$OS_OAM_NETWORK_CIDR~" $template
67 sed -ir -e "s/__oam_network_prefix__/$OS_OAM_NETWORK_PREFIX/" $template
68 sed -ir -e "s/__oam_network_id__/$OS_OAM_NETWORK_ID/" $template
69 sed -ir -e "s/__oam_subnet_id__/$OS_OAM_NETWORK_SUBNET_ID/" $template
70 sed -ir -e "s/__sec_group__/$OS_SEC_GROUP/" $template
72 sed -ir -e "s/\${OS_UBUNTU_14_IMAGE}/$OS_UBUNTU_14_IMAGE/" $template
73 sed -ir -e "s/\${OS_UBUNTU_16_IMAGE}/$OS_UBUNTU_16_IMAGE/" $template
75 sed -ir -e "s/\${MASTER_PASSWORD}/$MASTER_PASSWORD/" $template
77 sed -ir -e "s/__nfs_ip_addr__/$NFS_IP_ADDR/" $template
78 sed -ir -e "s/__k8s_01_vm_ip__/$K8S_01_VM_IP/" $template
81 cp $template $BUILD_DIR/$template