Add License to VES library
[demo.git] / boot / mso_vm_init.sh
1 #!/bin/bash
2
3 NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt)
4 NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt)
5 NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
6 OPENSTACK_USERNAME=$(cat /opt/config/openstack_username.txt)
7 OPENSTACK_APIKEY=$(cat /opt/config/api_key.txt)
8 DMAAP_TOPIC=$(cat /opt/config/dmaap_topic.txt)
9 export MSO_DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
10
11 if [ -e /opt/config/keystone.txt ]
12 then
13   KEYSTONE_URL=$(cat /opt/config/keystone.txt)
14 else
15   KEYSTONE_URL="https://identity.api.rackspacecloud.com/v2.0"
16 fi
17
18 # Update the MSO configuration file.
19 read -d '' MSO_CONFIG_UPDATES <<-EOF
20 {
21 "default_attributes":
22   {
23     "asdc-connections":
24       {
25             "asdc-controller1":
26             {
27                 "environmentName": "$DMAAP_TOPIC"
28             }
29       },
30       "mso-po-adapter-config": 
31           {
32             "identity_services": 
33                 [
34                     {"dcp_clli": "RAX_KEYSTONE", 
35                      "identity_url": "$KEYSTONE_URL",
36                      "mso_id": "$OPENSTACK_USERNAME", 
37                      "mso_pass": "$OPENSTACK_APIKEY", 
38                      "admin_tenant": "service", 
39                      "member_role": "admin", 
40                      "tenant_metadata": "true",
41                      "identity_server_type": "KEYSTONE", 
42                      "identity_authentication_type": "RACKSPACE_APIKEY"
43                         
44                     }
45                 ]
46           }
47   }
48 }
49 EOF
50 export MSO_CONFIG_UPDATES
51
52
53 # Deploy the environment
54 cd /opt/test_lab
55 git pull
56 chmod +x deploy.sh
57 #This script takes in input 2 nexus repos (the first one for the MSO image, the second one for mariadb)
58 ./deploy.sh $NEXUS_DOCKER_REPO $NEXUS_USERNAME $NEXUS_PASSWD $NEXUS_DOCKER_REPO $NEXUS_USERNAME $NEXUS_PASSWD