aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2018-04-20 14:53:11 -0400
committerMarco Platania <platania@research.att.com>2018-04-20 14:53:11 -0400
commitb32a99112d79bbdebf7711ba61a3850d1db5bb9b (patch)
treeeadbfb819dd0d471185ef28f54843319d3e6ed6f
parent3fe03b6e089ef105f32451bb0135b487bba36a4b (diff)
Update AAF configuration
- Pass local IP to AAF VM via Heat - Update aaf_vm_init.sh to change AAF (d.props) config at startup Change-Id: I6826306c6193b540a45814257879ac099f00fec2 Issue-ID: INT-444 Signed-off-by: Marco Platania <platania@research.att.com>
-rw-r--r--boot/aaf_vm_init.sh14
-rw-r--r--heat/ONAP/onap_openstack.yaml2
-rw-r--r--heat/ONAP/onap_openstack_light.yaml2
3 files changed, 14 insertions, 4 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/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