]> git.proxmox.com Git - mirror_ovs.git/blame - Vagrantfile
docs: Add FAQ to the main page.
[mirror_ovs.git] / Vagrantfile
CommitLineData
b56b2566
AZ
1# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5VAGRANTFILE_API_VERSION = "2"
3314f01e 6Vagrant.require_version ">=1.7.0"
b56b2566
AZ
7
8$bootstrap_fedora = <<SCRIPT
d64c5e86
MG
9dnf -y update
10dnf -y install autoconf automake openssl-devel libtool \
06c58061 11 python-twisted-core python-zope-interface \
e259119c 12 desktop-file-utils groff graphviz rpmdevtools nc \
6a6b35fc 13 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
e4f2c621 14 libcap-ng-devel kernel-devel-`uname -r` ethtool
b56b2566 15echo "search extra update built-in" >/etc/depmod.d/search_path.conf
7c127f28
TLSC
16SCRIPT
17
18$bootstrap_debian = <<SCRIPT
19aptitude -y update
20aptitude -y upgrade
21aptitude -y install -R \
22 build-essential dpkg-dev lintian devscripts fakeroot \
23 debhelper dh-autoreconf uuid-runtime \
24 autoconf automake libtool \
25 python-all python-twisted-core python-twisted-conch \
26 xdg-utils groff graphviz netcat \
27 wget python-six ethtool \
28 libcap-ng-dev libssl-dev python-dev openssl \
29 python-pyftpdlib python-flake8 \
30 linux-headers-`uname -r`
b56b2566
AZ
31SCRIPT
32
888e071e
TLSC
33$bootstrap_centos = <<SCRIPT
34yum -y update
35yum -y install autoconf automake openssl-devel libtool \
36 python-twisted-core python-zope-interface \
37 desktop-file-utils groff graphviz rpmdevtools nc \
38 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
39 libcap-ng-devel kernel-devel-`uname -r` ethtool
40SCRIPT
41
b56b2566 42$configure_ovs = <<SCRIPT
7c127f28
TLSC
43cd /vagrant
44./boot.sh
3d982663 45[ -f Makefile ] && ./configure && make distclean
b56b2566
AZ
46mkdir -p ~/build
47cd ~/build
1a523ec4 48/vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
b56b2566
AZ
49SCRIPT
50
51$build_ovs = <<SCRIPT
52cd ~/build
53make
54SCRIPT
55
3314f01e
AZ
56$test_kmod = <<SCRIPT
57cd ~/build
960e99dc 58make check-kmod RECHECK=yes
3314f01e
AZ
59SCRIPT
60
b56b2566
AZ
61$install_rpm = <<SCRIPT
62cd ~/build
63PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
64make && make dist
65rpmdev-setuptree
66cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
d06c1ff8 67rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
b56b2566 68rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
3314f01e 69rpm -e openvswitch
53de7528 70rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm
3314f01e
AZ
71systemctl enable openvswitch
72systemctl start openvswitch
73systemctl status openvswitch
b56b2566
AZ
74SCRIPT
75
888e071e
TLSC
76$install_centos_rpm = <<SCRIPT
77cd ~/build
78PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
79make && make dist
80rpmdev-setuptree
81cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
82rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-rhel6.spec
83rpmbuild --bb --without check /vagrant/rhel/openvswitch.spec
84rpm -e openvswitch
85rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.x86_64.rpm
86systemctl enable openvswitch
87systemctl start openvswitch
88systemctl status openvswitch
89SCRIPT
90
7c127f28
TLSC
91$install_deb = <<SCRIPT
92cd ~/build
93PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
94make dist
95cd ~/
96ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz
97rm -rf ~/openvswitch-$PACKAGE_VERSION
98tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz
99cd ~/openvswitch-$PACKAGE_VERSION
100debuild -us -uc
101dpkg -i ../openvswitch-{common,switch}*deb
102systemctl enable openvswitch-switch
103systemctl start openvswitch-switch
104systemctl status openvswitch-switch
105SCRIPT
106
548f9fe7
DDP
107$test_ovs_system_userspace = <<SCRIPT
108cd ~/build
960e99dc 109make check-system-userspace RECHECK=yes
548f9fe7
DDP
110SCRIPT
111
b56b2566 112Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7c127f28
TLSC
113 config.vm.define "debian-8" do |debian|
114 debian.vm.box = "debian/jessie64"
115 debian.vm.synced_folder ".", "/vagrant", type: "rsync"
116 debian.vm.provision "bootstrap", type: "shell", inline: $bootstrap_debian
117 debian.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
118 debian.vm.provision "build_ovs", type: "shell", inline: $build_ovs
119 debian.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
120 debian.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
121 debian.vm.provision "install_deb", type: "shell", inline: $install_deb
122 end
53de7528
JS
123 config.vm.define "fedora-23" do |fedora|
124 fedora.vm.box = "bento/fedora-23"
3314f01e
AZ
125 fedora.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora
126 fedora.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
127 fedora.vm.provision "build_ovs", type: "shell", inline: $build_ovs
128 fedora.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
548f9fe7 129 fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
3314f01e
AZ
130 fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm
131 end
888e071e
TLSC
132 config.vm.define "centos-7.2" do |centos|
133 centos.vm.box = "bento/centos-7.2"
134 centos.vm.synced_folder ".", "/vagrant", type: "rsync"
135 centos.vm.provision "bootstrap", type: "shell", inline: $bootstrap_centos
136 centos.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
137 centos.vm.provision "build_ovs", type: "shell", inline: $build_ovs
138 centos.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
139 centos.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
140 centos.vm.provision "install_rpm", type: "shell", inline: $install_centos_rpm
141 end
b56b2566 142end