blob: 0c04e178c49bd2a5eecd869e2d2c6f0e9769d582 [file] [log] [blame]
hwchiu26396862017-12-27 22:10:34 +08001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
Andrea Campanella6adf0022018-06-19 16:24:17 +02004required_plugins = %w(vagrant-reload vagrant-vbguest)
5
6plugins_to_install = required_plugins.select { |plugin| not Vagrant.has_plugin? plugin }
7if not plugins_to_install.empty?
8 puts "Installing plugins: #{plugins_to_install.join(' ')}"
9 if system "vagrant plugin install #{plugins_to_install.join(' ')}"
10 exec "vagrant #{ARGV.join(' ')}"
11 else
12 abort "Installation of one or more plugins has failed. Aborting."
13 end
14end
15
hwchiu26396862017-12-27 22:10:34 +080016Vagrant.configure("2") do |config|
17 config.vm.box = "ubuntu/xenial64"
Andrea Campanella6adf0022018-06-19 16:24:17 +020018 config.vm.box_version = "20180717.0.0"
hwchiu26396862017-12-27 22:10:34 +080019 config.vm.hostname = 'trellis-example'
Andrea Campanella0a219562018-07-04 14:51:35 +020020 config.ssh.forward_agent = true
21 config.ssh.forward_x11 = true
hwchiu26396862017-12-27 22:10:34 +080022
23 config.vm.provision "shell", privileged: false, inline: <<-SHELL
24 set -e -x -u
25 sudo apt-get update
26 sudo apt-get install -y gawk texinfo python-pip build-essential iptables automake autoconf libtool mininet isc-dhcp-server
Andrea Campanella0a219562018-07-04 14:51:35 +020027 sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install wireshark
hwchiu26396862017-12-27 22:10:34 +080028 sudo pip install -U pip
29 sudo pip install ipaddress
30 git clone -b onos-1.11 https://gerrit.opencord.org/quagga
31 cd quagga
32 ./bootstrap.sh
33 ./configure --enable-fpm --sbindir=/usr/lib/quagga enable_user=root enable_group=root
34 make
35 sudo make install
36 cd ..
37
38 sudo /etc/init.d/apparmor stop
39 sudo ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/
40 sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd
41 sudo sed -i '30i /var/lib/dhcp{,3}/dhcpclient* lrw,' /etc/apparmor.d/sbin.dhclient
42 sudo /etc/init.d/apparmor start
43
44 git clone https://gerrit.onosproject.org/routing
45
46 sudo ldconfig
Andrea Campanella6adf0022018-06-19 16:24:17 +020047
48 mkdir 4.15 && cd 4.15
49 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-headers-4.15.0-041500_4.15.0-041500.201802011154_all.deb
50 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-headers-4.15.0-041500-generic_4.15.0-041500.201802011154_amd64.deb
51 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-image-4.15.0-041500-generic_4.15.0-041500.201802011154_amd64.deb
52 sudo dpkg -i *.deb
53 SHELL
54
55 config.vm.provision :reload
56
57 config.vm.provision "shell", privileged: true, inline: <<-SHELL
58 /etc/init.d/openvswitch-switch stop
59 cd /tmp
60 wget http://openvswitch.org/releases/openvswitch-2.9.2.tar.gz
61 tar zxvf openvswitch-2.9.2.tar.gz
62 cd openvswitch-2.9.2
63 ./configure --prefix=/usr --with-linux=/lib/modules/`uname -r`/build
64 make
65 make install
66 make modules_install
67 rmmod openvswitch
68 depmod -a
69 /etc/init.d/openvswitch-switch start
70 rm -rf /tmp/openvswitch-2.9.2*
71 ovs-vsctl set Open_vSwitch . other_config:vlan-limit=2
72 SHELL
hwchiu26396862017-12-27 22:10:34 +080073
74 config.vm.provider :virtualbox do |v|
75 v.customize ["modifyvm", :id, "--cpus", 2]
76 # enable this when you want to have more memory
77 # v.customize ["modifyvm", :id, "--memory", 4096]
78 v.customize ['modifyvm', :id, '--nicpromisc1', 'allow-all']
79 end
80end