3 # Read configuration files
4 NEXUS_REPO=$(cat /opt/config/nexus_repo.txt)
5 ARTIFACTS_VERSION=$(cat /opt/config/artifacts_version.txt)
6 CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
8 if [[ $CLOUD_ENV != "rackspace" ]]
10 # Add host name to /etc/host to avoid warnings in openstack images
11 echo 127.0.0.1 $(hostname) >> /etc/hosts
13 # Set the Bind configuration file name based on the deployment environment
14 ZONE_FILE="bind_zones"
15 OPTIONS_FILE="bind_options"
17 ZONE_FILE="db_simpledemo_openecomp_org"
18 OPTIONS_FILE="named.conf.options"
21 # Set private IP in /etc/network/interfaces manually in the presence of public interface
22 # Some VM images don't add the private interface automatically, we have to do it during the component installation
23 if [[ $CLOUD_ENV == "openstack_nofloat" ]]
25 LOCAL_IP=$(cat /opt/config/dns_ip_addr.txt)
26 CIDR=$(cat /opt/config/oam_network_cidr.txt)
27 BITMASK=$(echo $CIDR | cut -d"/" -f2)
29 # Compute the netmask based on the network cidr
30 if [[ $BITMASK == "8" ]]
33 elif [[ $BITMASK == "16" ]]
36 elif [[ $BITMASK == "24" ]]
41 echo "auto eth1" >> /etc/network/interfaces
42 echo "iface eth1 inet static" >> /etc/network/interfaces
43 echo " address $LOCAL_IP" >> /etc/network/interfaces
44 echo " netmask $NETMASK" >> /etc/network/interfaces
48 # Download dependencies
49 add-apt-repository -y ppa:openjdk-r/ppa
51 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate
55 curl -k $NEXUS_REPO/org.openecomp.demo/boot/$ARTIFACTS_VERSION/$ZONE_FILE -o /etc/bind/zones/db.simpledemo.openecomp.org
56 curl -k $NEXUS_REPO/org.openecomp.demo/boot/$ARTIFACTS_VERSION/$OPTIONS_FILE -o /etc/bind/named.conf.options
57 curl -k $NEXUS_REPO/org.openecomp.demo/boot/$ARTIFACTS_VERSION/named.conf.local -o /etc/bind/named.conf.local
59 # Set the private IP address of each ONAP VM in the Bind configuration in OpenStack deployments
60 if [[ $CLOUD_ENV != "rackspace" ]]
62 sed -i "s/dns_ip_addr/"$(cat /opt/config/dns_ip_addr.txt)"/g" /etc/bind/named.conf.options
63 sed -i "s/aai_ip_addr/"$(cat /opt/config/aai_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
64 sed -i "s/appc_ip_addr/"$(cat /opt/config/appc_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
65 sed -i "s/dcae_ip_addr/"$(cat /opt/config/dcae_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
66 sed -i "s/dns_ip_addr/"$(cat /opt/config/dns_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
67 sed -i "s/mso_ip_addr/"$(cat /opt/config/mso_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
68 sed -i "s/mr_ip_addr/"$(cat /opt/config/mr_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
69 sed -i "s/policy_ip_addr/"$(cat /opt/config/policy_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
70 sed -i "s/portal_ip_addr/"$(cat /opt/config/portal_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
71 sed -i "s/robot_ip_addr/"$(cat /opt/config/robot_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
72 sed -i "s/sdc_ip_addr/"$(cat /opt/config/sdc_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
73 sed -i "s/sdnc_ip_addr/"$(cat /opt/config/sdnc_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
74 sed -i "s/vid_ip_addr/"$(cat /opt/config/vid_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
75 sed -i "s/dcae_coll_ip_addr/"$(cat /opt/config/dcae_coll_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
80 sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9