blob: 0c04e178c49bd2a5eecd869e2d2c6f0e9769d582 [file] [log] [blame]
# -*- mode: ruby -*-
# vi: set ft=ruby :
required_plugins = %w(vagrant-reload vagrant-vbguest)
plugins_to_install = required_plugins.select { |plugin| not Vagrant.has_plugin? plugin }
if not plugins_to_install.empty?
puts "Installing plugins: #{plugins_to_install.join(' ')}"
if system "vagrant plugin install #{plugins_to_install.join(' ')}"
exec "vagrant #{ARGV.join(' ')}"
else
abort "Installation of one or more plugins has failed. Aborting."
end
end
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box_version = "20180717.0.0"
config.vm.hostname = 'trellis-example'
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.vm.provision "shell", privileged: false, inline: <<-SHELL
set -e -x -u
sudo apt-get update
sudo apt-get install -y gawk texinfo python-pip build-essential iptables automake autoconf libtool mininet isc-dhcp-server
sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install wireshark
sudo pip install -U pip
sudo pip install ipaddress
git clone -b onos-1.11 https://gerrit.opencord.org/quagga
cd quagga
./bootstrap.sh
./configure --enable-fpm --sbindir=/usr/lib/quagga enable_user=root enable_group=root
make
sudo make install
cd ..
sudo /etc/init.d/apparmor stop
sudo ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd
sudo sed -i '30i /var/lib/dhcp{,3}/dhcpclient* lrw,' /etc/apparmor.d/sbin.dhclient
sudo /etc/init.d/apparmor start
git clone https://gerrit.onosproject.org/routing
sudo ldconfig
mkdir 4.15 && cd 4.15
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-headers-4.15.0-041500_4.15.0-041500.201802011154_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-headers-4.15.0-041500-generic_4.15.0-041500.201802011154_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-image-4.15.0-041500-generic_4.15.0-041500.201802011154_amd64.deb
sudo dpkg -i *.deb
SHELL
config.vm.provision :reload
config.vm.provision "shell", privileged: true, inline: <<-SHELL
/etc/init.d/openvswitch-switch stop
cd /tmp
wget http://openvswitch.org/releases/openvswitch-2.9.2.tar.gz
tar zxvf openvswitch-2.9.2.tar.gz
cd openvswitch-2.9.2
./configure --prefix=/usr --with-linux=/lib/modules/`uname -r`/build
make
make install
make modules_install
rmmod openvswitch
depmod -a
/etc/init.d/openvswitch-switch start
rm -rf /tmp/openvswitch-2.9.2*
ovs-vsctl set Open_vSwitch . other_config:vlan-limit=2
SHELL
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--cpus", 2]
# enable this when you want to have more memory
# v.customize ["modifyvm", :id, "--memory", 4096]
v.customize ['modifyvm', :id, '--nicpromisc1', 'allow-all']
end
end