Make vagrant work behind a proxy

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>
This commit is contained in:
Kyle Mestery
2018-08-10 16:32:13 -05:00
committed by Dave Barach
parent ce96dda447
commit acc1fbcb5e
6 changed files with 17 additions and 13 deletions

View 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

View File

@ -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

View File

@ -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

View 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

8
extras/vagrant/install.sh Normal file → Executable file
View File

@ -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
(cd ${VPP_DIR}/build-root/;sudo -E rpm -Uvh *.rpm)
fi

View File

@ -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