1f89a4ef25432c819a4fb3dde5d0dd086e317dcb
[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=latest
10
11 # Update the MSO configuration file.
12 read -d '' MSO_CONFIG_UPDATES <<-EOF
13 {
14 "default_attributes":
15   {
16     "asdc-connections":
17       {
18             "asdc-controller1":
19             {
20                 "environmentName": "$DMAAP_TOPIC"
21             }
22       },
23       "mso-po-adapter-config": 
24           {
25             "identity_services": 
26                 [
27                     {"dcp_clli": "RAX_KEYSTONE", 
28                      "identity_url": "https://identity.api.rackspacecloud.com/v2.0", 
29                      "mso_id": "$OPENSTACK_USERNAME", 
30                      "mso_pass": "$OPENSTACK_APIKEY", 
31                      "admin_tenant": "service", 
32                      "member_role": "admin", 
33                      "tenant_metadata": "true",
34                      "identity_server_type": "KEYSTONE", 
35                      "identity_authentication_type": "RACKSPACE_APIKEY"
36                         
37                     }
38                 ]
39           }
40   }
41 }
42 EOF
43 export MSO_CONFIG_UPDATES
44
45
46 # Deploy the environment
47 cd /opt/test_lab
48 git pull
49 chmod +x deploy.sh
50 #This script takes in input 2 nexus repos (the first one for the MSO image, the second one for mariadb)
51 ./deploy.sh $NEXUS_DOCKER_REPO $NEXUS_USERNAME $NEXUS_PASSWD $NEXUS_DOCKER_REPO $NEXUS_USERNAME $NEXUS_PASSWD