aboutsummaryrefslogtreecommitdiffstats
path: root/boot/nbi_install.sh
diff options
context:
space:
mode:
authorRene Robert <rene.robert@orange.com>2018-04-16 12:48:30 +0000
committerRene Robert <rene.robert@orange.com>2018-04-16 12:50:32 +0000
commitd0a28c37338215265449d013dbbdd96962334b00 (patch)
tree9782a63ffd7b9b9b9d723ad0a613dee65e1467a0 /boot/nbi_install.sh
parentdc99e44fd343d7236bfa4c4d54f8444c421b0e72 (diff)
complete nbi install
Issue-ID: INT-456 Change-Id: I8a16fde4627f61af7556006fafc0dcbfd9a429cc Signed-off-by: Rene Robert <rene.robert@orange.com>
Diffstat (limited to 'boot/nbi_install.sh')
-rw-r--r--boot/nbi_install.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/boot/nbi_install.sh b/boot/nbi_install.sh
index c5f5ce4c..71546016 100644
--- a/boot/nbi_install.sh
+++ b/boot/nbi_install.sh
@@ -5,7 +5,9 @@ NEXUS_REPO=$(cat /opt/config/nexus_repo.txt)
ARTIFACTS_VERSION=$(cat /opt/config/artifacts_version.txt)
DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt)
CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
+GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt)
MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
+CODE_REPO=$(cat /opt/config/remote_repo.txt)
# Add host name to /etc/host to avoid warnings in openstack images
if [[ $CLOUD_ENV != "rackspace" ]]
@@ -60,7 +62,7 @@ mv /opt/nbi_serv.sh /etc/init.d
update-rc.d nbi_serv.sh defaults
# Download and install docker-engine and docker-compose
-echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | tee /etc/apt/sources.list.d/docker.list
+echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
apt-get install -y --allow-unauthenticated docker-engine
@@ -89,6 +91,18 @@ service docker restart
echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head
resolvconf -u
-# Clone Gerrit repository and run docker containers
+# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
+if [[ $CLOUD_ENV != "rackspace" ]]
+then
+ sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
+ grub-mkconfig -o /boot/grub/grub.cfg
+ sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
+ sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
+ echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
+ echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
+ reboot
+fi
+
+# Run docker containers
cd /opt
./nbi_vm_init.sh