3 REPO_URL_BLOB=$(cat /opt/config/repo_url_blob.txt)
4 REPO_URL_ARTIFACTS=$(cat /opt/config/repo_url_artifacts.txt)
5 DEMO_ARTIFACTS_VERSION=$(cat /opt/config/demo_artifacts_version.txt)
6 INSTALL_SCRIPT_VERSION=$(cat /opt/config/install_script_version.txt)
7 CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
9 # OpenStack network configuration
10 if [[ $CLOUD_ENV == "openstack" ]]
12 echo 127.0.0.1 $(hostname) >> /etc/hosts
14 # Allow remote login as root
15 mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.bk
16 cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
18 MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
20 VFW_PRIVATE_IP_O=$(cat /opt/config/vfw_private_ip_0.txt)
21 echo "auto eth1" >> /etc/network/interfaces
22 echo "iface eth1 inet static" >> /etc/network/interfaces
23 echo " address $VFW_PRIVATE_IP_O" >> /etc/network/interfaces
24 echo " netmask 255.255.255.0" >> /etc/network/interfaces
25 echo " mtu $MTU" >> /etc/network/interfaces
27 VFW_PRIVATE_IP_1=$(cat /opt/config/vfw_private_ip_1.txt)
28 echo "auto eth2" >> /etc/network/interfaces
29 echo "iface eth2 inet static" >> /etc/network/interfaces
30 echo " address $VFW_PRIVATE_IP_1" >> /etc/network/interfaces
31 echo " netmask 255.255.255.0" >> /etc/network/interfaces
32 echo " mtu $MTU" >> /etc/network/interfaces
34 VFW_PRIVATE_IP_2=$(cat /opt/config/vfw_private_ip_2.txt)
35 echo "auto eth3" >> /etc/network/interfaces
36 echo "iface eth3 inet static" >> /etc/network/interfaces
37 echo " address $VFW_PRIVATE_IP_2" >> /etc/network/interfaces
38 echo " netmask 255.255.255.0" >> /etc/network/interfaces
39 echo " mtu $MTU" >> /etc/network/interfaces
46 # Download required dependencies
47 add-apt-repository -y ppa:openjdk-r/ppa
49 apt-get install -y make wget openjdk-8-jdk gcc libcurl4-openssl-dev python-pip bridge-utils apt-transport-https ca-certificates
50 pip install jsonschema
52 # Download artifacts for virtual firewall
56 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$INSTALL_SCRIPT_VERSION/v_firewall_init.sh
57 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$INSTALL_SCRIPT_VERSION/vfirewall.sh
58 wget $REPO_URL_ARTIFACTS/org/openecomp/demo/vnf/sample-distribution/$DEMO_ARTIFACTS_VERSION/sample-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz
59 wget $REPO_URL_ARTIFACTS/org/openecomp/demo/vnf/ves/ves/$DEMO_ARTIFACTS_VERSION/ves-$DEMO_ARTIFACTS_VERSION-demo.tar.gz
60 wget $REPO_URL_ARTIFACTS/org/openecomp/demo/vnf/ves/ves_vfw_reporting/$DEMO_ARTIFACTS_VERSION/ves_vfw_reporting-$DEMO_ARTIFACTS_VERSION-demo.tar.gz
62 tar -zxvf ves-$DEMO_ARTIFACTS_VERSION-demo.tar.gz
63 mv ves-$DEMO_ARTIFACTS_VERSION VES
64 tar -zxvf ves_vfw_reporting-$DEMO_ARTIFACTS_VERSION-demo.tar.gz
65 mv ves_vfw_reporting-$DEMO_ARTIFACTS_VERSION VESreporting_vFW
66 tar -zxvf sample-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz
67 mv sample-distribution-$DEMO_ARTIFACTS_VERSION honeycomb
68 sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' honeycomb/sample-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json
69 mv VESreporting_vFW /opt/VES/code/evel_training/VESreporting
71 chmod +x v_firewall_init.sh
75 export UBUNTU="trusty"
76 export RELEASE=".stable.1609"
77 rm /etc/apt/sources.list.d/99fd.io.list
78 echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io$RELEASE.ubuntu.$UBUNTU.main/ ./" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list
80 apt-get install -y vpp vpp-dpdk-dkms vpp-lib vpp-dbg vpp-plugins vpp-dev
89 # Run instantiation script
91 mv vfirewall.sh /etc/init.d
92 update-rc.d vfirewall.sh defaults