Make vagrant work behind a proxy 48/14148/2
authorKyle Mestery <mestery@mestery.com>
Fri, 10 Aug 2018 21:32:13 +0000 (16:32 -0500)
committerDave Barach <openvpp@barachs.net>
Tue, 14 Aug 2018 20:16:51 +0000 (20:16 +0000)
Without this change, I cannot get the in-tree VPP Vagrant to work behind
a proxy. This commit fixes that by ensuring when we run sudo we're passing
environment variables, amongst some other cleanups.

Change-Id: Ica98a1238d40e6e6ccf80c472f52559c95af52f0
Signed-off-by: Kyle Mestery <mestery@mestery.com>
extras/vagrant/Vagrantfile
extras/vagrant/build.sh
extras/vagrant/clearinterfaces.sh
extras/vagrant/env.sh
extras/vagrant/install.sh [changed mode: 0644->0755]
extras/vagrant/run.sh

index badaa97..a97a3dc 100644 (file)
@@ -12,6 +12,8 @@ Vagrant.configure(2) do |config|
   elsif distro == 'opensuse'
     config.vm.box = "opensuse/openSUSE-42.3-x86_64"
     config.vm.box_version = "1.0.4.20170726"
+  elsif distro == 'ubuntu1804'
+    config.vm.box = "bento/ubuntu-18.04"
   else
     config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm"
   end
index 86ed4cd..3a10e70 100755 (executable)
@@ -47,13 +47,13 @@ rm -f build-root/.bootstrap.ok
 if [ $OS_ID == "centos" ]; then
     echo rpm -V apr-devel
     rpm -V apr-devel
-    if [ $? != 0 ]; then sudo yum reinstall -y apr-devel;fi
+    if [ $? != 0 ]; then sudo -E yum reinstall -y apr-devel;fi
     echo rpm -V ganglia-devel
     rpm -V ganglia-devel
-    if [ $? != 0 ]; then sudo yum reinstall -y ganglia-devel;fi
+    if [ $? != 0 ]; then sudo -E yum reinstall -y ganglia-devel;fi
     echo rpm -V libconfuse-devel
     rpm -V libconfuse-devel
-    if [ $? != 0 ]; then sudo yum reinstall -y libconfuse-devel;fi
+    if [ $? != 0 ]; then sudo -E yum reinstall -y libconfuse-devel;fi
 fi
 
 # Build and install packaging
index 78f6705..31a6309 100755 (executable)
@@ -12,6 +12,6 @@ chown vagrant:vagrant ~vagrant/ifconfiga
 for intf in $(ls /sys/class/net) ; do
     if [ -d /sys/class/net/$intf/device ] &&
         [ "$(route --inet --inet6 | grep default | grep $intf)" == "" ] ; then
-        ifconfig $intf down
+        sudo -E ifconfig $intf down
     fi
 done
index bd329ea..441a4c1 100644 (file)
@@ -1,6 +1,7 @@
 #!/usr/bin/env bash
 
-export VPP_VAGRANT_DISTRO="ubuntu1604"
+export VPP_VAGRANT_DISTRO="ubuntu1804"
 export VPP_VAGRANT_NICS=2
 export VPP_VAGRANT_VMCPU=4
 export VPP_VAGRANT_VMRAM=4096
+export VPP_VAGRANT_POST_BUILD=install
old mode 100644 (file)
new mode 100755 (executable)
index a53faa4..cfe5fe5
@@ -12,7 +12,7 @@ fi
 if [ -f /etc/lsb-release ];then
     . /etc/lsb-release
 elif [ -f /etc/redhat-release ];then
-    sudo yum install -y redhat-lsb
+    sudo -E yum install -y redhat-lsb
     DISTRIB_ID=`lsb_release -si`
     DISTRIB_RELEASE=`lsb_release -sr`
     DISTRIB_CODENAME=`lsb_release -sc`
@@ -24,7 +24,7 @@ echo DISTRIB_CODENAME: $DISTRIB_CODENAME
 echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION
 
 if [ $DISTRIB_ID == "Ubuntu" ]; then
-    (cd ${VPP_DIR}/build-root/;sudo dpkg -i *.deb)
+    (cd ${VPP_DIR}/build-root/;sudo -E dpkg -i *.deb)
 elif [ $DISTRIB_ID == "CentOS" ]; then
-    (cd ${VPP_DIR}/build-root/;sudo rpm -Uvh *.rpm)
-fi
\ No newline at end of file
+    (cd ${VPP_DIR}/build-root/;sudo -E rpm -Uvh *.rpm)
+fi
index 3c779fa..61c9261 100755 (executable)
@@ -12,11 +12,12 @@ fi
 
 if [ "$OS_ID" == "centos" ] || [ "$OS_ID" == "opensuse" ]; then
     # Install uio-pci-generic
-    modprobe uio_pci_generic
+    sudo -E modprobe uio_pci_generic
 fi
+
 echo "Starting VPP..."
-if [ "$OS_ID" == "ubuntu" ] && [ $OS_CODENAME = "trusty" ] ; then
-    start vpp
+if [ "$OS_ID" == "ubuntu" ] && [ "$OS_CODENAME" == "trusty" ] ; then
+    sudo -E start vpp
 else
-    service vpp start
+    sudo -E service vpp start
 fi