Add security group to vFW, vLB
[demo.git] / boot / dns_install.sh
index 4bfdbff..1f940ac 100644 (file)
@@ -3,6 +3,14 @@
 # Read configuration files
 ARTIFACTS_VERSION=$(cat /opt/config/artifacts_version.txt)
 CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
+HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
+HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
+
+if [ $HTTP_PROXY != "no_proxy" ]
+then
+    export http_proxy=$HTTP_PROXY
+    export https_proxy=$HTTPS_PROXY
+fi
 
 
 if [[ $CLOUD_ENV != "rackspace" ]]
@@ -24,38 +32,9 @@ else
        OPTIONS_FILE="named.conf.options"
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/dns_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
-echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >>  /etc/apt/sources.list.d/java.list
-echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >>  /etc/apt/sources.list.d/java.list
 apt-get update
-apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate make
+apt-get install -y apt-transport-https ca-certificates wget bind9 bind9utils bind9-doc ntp ntpdate make
 
 # Download script
 mkdir /etc/bind/zones
@@ -64,12 +43,10 @@ unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip $ZONE_ONAP > /etc/bind/zones/db.sim
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip $OPTIONS_FILE > /etc/bind/named.conf.options
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip named.conf.local > /etc/bind/named.conf.local
 
-
-
 # Set the private IP address of each ONAP VM in the Bind configuration in OpenStack deployments
 if [[ $CLOUD_ENV != "rackspace" ]]
 then
-        sed -i "s/dns_forwarder/"$(cat /opt/config/dns_forwarder.txt)"/g" /etc/bind/named.conf.options
+    sed -i "s/dns_forwarder/"$(cat /opt/config/dns_forwarder.txt)"/g" /etc/bind/named.conf.options
        sed -i "s/dns_ip_addr/"$(cat /opt/config/dns_ip_addr.txt)"/g" /etc/bind/named.conf.options
        sed -i "s/external_dns/"$(cat /opt/config/external_dns.txt)"/g" /etc/bind/named.conf.options
        sed -i "s/aai1_ip_addr/"$(cat /opt/config/aai1_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org