diff options
-rw-r--r-- | boot/aaf_vm_init.sh | 14 | ||||
-rw-r--r-- | boot/oof_vm_init.sh | 27 | ||||
-rw-r--r-- | heat/ONAP/onap_openstack.yaml | 2 | ||||
-rw-r--r-- | heat/ONAP/onap_openstack_light.yaml | 2 |
4 files changed, 35 insertions, 10 deletions
diff --git a/boot/aaf_vm_init.sh b/boot/aaf_vm_init.sh index 7bc868a8..f3ca911e 100644 --- a/boot/aaf_vm_init.sh +++ b/boot/aaf_vm_init.sh @@ -4,19 +4,25 @@ NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) +LOCAL_IP=$(cat /opt/config/local_ip.txt) +CASSANDRA_CONTAINER_NAME="aaf_cass" docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO cd /opt/authz git pull -sed -i "s/DOCKER_REPOSITORY=.*/DOCKER_REPOSITORY="$NEXUS_DOCKER_REPO"/g" /opt/authz/auth/docker/d.props -sed -i "s/VERSION=.*/VERSION="$DOCKER_IMAGE_VERSION"/g" /opt/authz/auth/docker/d.props - cd /opt/authz/auth/auth-cass/docker ./dinstall.sh - sleep 2 +#Update configuration file +CASSANDRA_CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $CASSANDRA_CONTAINER_NAME) +sed -i "s/DOCKER_REPOSITORY=.*/DOCKER_REPOSITORY="$NEXUS_DOCKER_REPO"/g" /opt/authz/auth/docker/d.props +sed -i "s/VERSION=.*/VERSION="$DOCKER_IMAGE_VERSION"/g" /opt/authz/auth/docker/d.props +sed -i "s/HOSTNAME=.*/HOSTNAME="$(hostname)"/g" /opt/authz/auth/docker/d.props +sed -i "s/HOST_IP=.*/HOST_IP="$LOCAL_IP"/g" /opt/authz/auth/docker/d.props +sed -i "s/CASS_HOST=cass.aaf.osaaf.org:.*/CASS_HOST=cass.aaf.osaaf.org:"$CASSANDRA_CONTAINER_IP"/g" /opt/authz/auth/docker/d.props + cd /opt/authz/auth/docker ./drun.sh
\ No newline at end of file diff --git a/boot/oof_vm_init.sh b/boot/oof_vm_init.sh index 836aa346..e4dc2c88 100644 --- a/boot/oof_vm_init.sh +++ b/boot/oof_vm_init.sh @@ -1,17 +1,21 @@ #!/bin/bash +CERT=/opt/optf-has/aai.cer +KEY=/opt/optf-has/aai.key +BUNDLE=/opt/optf-has/aai_bundle.pem + NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) cd /opt/optf-has -git pull +#git pull COND_CONF=/opt/optf-has/conductor.conf LOG_CONF=/opt/optf-has/log.conf -#THE FOLLOWING LINE IS A PLACEHOLDER +#!!! THE FOLLOWING LINE IS A PLACEHOLDER !!! AAI_cert=/opt/optf-has/aai_cert.cer IMAGE_NAME="$NEXUS_DOCKER_REPO/onap/optf-has" @@ -39,7 +43,7 @@ mkdir -p /opt/optf-has/music/properties mkdir -p /opt/optf-has/music/logs # add music.properties file -cat >> /opt/optf-has/music/properties/music.properties << NEWFILE +cat > /opt/optf-has/music/properties/music.properties<<NEWFILE my.id=0 all.ids=0 my.public.ip=localhost @@ -88,19 +92,30 @@ docker run -d --rm --name music-tomcat --network music-net -p "8080:8080" -v mus docker network connect bridge music-tomcat; # Get MUSIC url -MUSIC_URL=$(docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat) +#MUSIC_URL=$(docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat) +MUSIC_URL=localhost # Set A&AI and MUSIC url inside OOF-HAS conductor.conf sed -i "138 s%.*%server_url = https://aai.api.simpledemo.onap.org:8443/aai%" $COND_CONF sed -i "141 s%.*%server_url_version = v13%" $COND_CONF -sed -i "250 s%.*%server_url = $MUSIC_URL:8080/MUSIC/rest/v2%" $COND_CONF +#sed -i "250 s%.*%server_url = $MUSIC_URL:8080/MUSIC/rest/v2%" $COND_CONF # Set A&AI authentication file locations inside OOF-HAS conductor.conf sed -i "153 s%.*%certificate_authority_bundle_file = $AAI_cert%" $COND_CONF + +echo "Values to data component" +echo $CERT +echo $KEY +echo $BUNDLE + # run optf-has docker run -d --name controller -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-controller --config-file=/usr/local/bin/conductor.conf + docker run -d --name api -p "8091:8091" -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-api --port=8091 -- --config-file=/usr/local/bin/conductor.conf + docker run -d --name solver -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-solver --config-file=/usr/local/bin/conductor.conf + docker run -d --name reservation -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-reservation --config-file=/usr/local/bin/conductor.conf -docker run -d --name data -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf -v $CERT:/usr/local/bin/aai_cert.cer -v $KEY:/usr/local/bin/aai_key.key -v $BUNDLE:/usr/local/bin/bundle.pem ${IMAGE_NAME}:latest python /usr/local/bin/conductor-data --config-file=/usr/local/bin/conductor.conf
\ No newline at end of file + +docker run -d --name data -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf -v $CERT:/usr/local/bin/aai_cert.cer -v $KEY:/usr/local/bin/aai_key.key -v $BUNDLE:/usr/local/bin/bundle.pem ${IMAGE_NAME}:latest python /usr/local/bin/conductor-data --config-file=/usr/local/bin/conductor.conf diff --git a/heat/ONAP/onap_openstack.yaml b/heat/ONAP/onap_openstack.yaml index 51495cef..a7598de7 100644 --- a/heat/ONAP/onap_openstack.yaml +++ b/heat/ONAP/onap_openstack.yaml @@ -2148,6 +2148,7 @@ resources: __external_dns__: { get_param: external_dns } __aaf_repo__: { get_param: aaf_repo } __gerrit_branch__: { get_param: aaf_branch } + __local_ip__: { get_param: aaf_ip_addr } template: | #!/bin/bash @@ -2164,6 +2165,7 @@ resources: echo "__external_dns__" > /opt/config/external_dns.txt echo "__aaf_repo__" > /opt/config/remote_repo.txt echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt + echo "__local_ip__" > /opt/config/local_ip.txt # Download and run install script curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/aaf_install.sh -o /opt/aaf_install.sh diff --git a/heat/ONAP/onap_openstack_light.yaml b/heat/ONAP/onap_openstack_light.yaml index dc0db557..117a3180 100644 --- a/heat/ONAP/onap_openstack_light.yaml +++ b/heat/ONAP/onap_openstack_light.yaml @@ -2026,6 +2026,7 @@ resources: __external_dns__: { get_param: external_dns } __aaf_repo__: { get_param: aaf_repo } __gerrit_branch__: { get_param: aaf_branch } + __local_ip__: { get_param: aaf_ip_addr } template: | #!/bin/bash @@ -2042,6 +2043,7 @@ resources: echo "__external_dns__" > /opt/config/external_dns.txt echo "__aaf_repo__" > /opt/config/remote_repo.txt echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt + echo "__local_ip__" > /opt/config/local_ip.txt # Download and run install script curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/aaf_install.sh -o /opt/aaf_install.sh |