diff mbox

[ovs-dev] vagrant: add CentOS 7.2 support

Message ID 1475003591-5582-1-git-send-email-cascardo@redhat.com
State Accepted
Headers show

Commit Message

Thadeu Lima de Souza Cascardo Sept. 27, 2016, 7:13 p.m. UTC
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
---
 Vagrantfile | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

Comments

Ben Pfaff Oct. 12, 2016, 7:33 p.m. UTC | #1
On Tue, Sep 27, 2016 at 04:13:11PM -0300, Thadeu Lima de Souza Cascardo wrote:
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>

Applied to master, thanks!
diff mbox

Patch

diff --git a/Vagrantfile b/Vagrantfile
index 91f943d..f83d3fc 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -30,6 +30,15 @@  aptitude -y install -R \
 		linux-headers-`uname -r`
 SCRIPT
 
+$bootstrap_centos = <<SCRIPT
+yum -y update
+yum -y install autoconf automake openssl-devel libtool \
+               python-twisted-core python-zope-interface \
+               desktop-file-utils groff graphviz rpmdevtools nc \
+               wget python-six pyftpdlib checkpolicy selinux-policy-devel \
+               libcap-ng-devel kernel-devel-`uname -r` ethtool
+SCRIPT
+
 $configure_ovs = <<SCRIPT
 cd /vagrant
 ./boot.sh
@@ -65,6 +74,21 @@  systemctl start openvswitch
 systemctl status openvswitch
 SCRIPT
 
+$install_centos_rpm = <<SCRIPT
+cd ~/build
+PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
+make && make dist
+rpmdev-setuptree
+cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
+rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-rhel6.spec
+rpmbuild --bb --without check /vagrant/rhel/openvswitch.spec
+rpm -e openvswitch
+rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.x86_64.rpm
+systemctl enable openvswitch
+systemctl start openvswitch
+systemctl status openvswitch
+SCRIPT
+
 $install_deb = <<SCRIPT
 cd ~/build
 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
@@ -106,4 +130,14 @@  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
        fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
        fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm
   end
+  config.vm.define "centos-7.2" do |centos|
+       centos.vm.box = "bento/centos-7.2"
+       centos.vm.synced_folder ".", "/vagrant", type: "rsync"
+       centos.vm.provision "bootstrap", type: "shell", inline: $bootstrap_centos
+       centos.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
+       centos.vm.provision "build_ovs", type: "shell", inline: $build_ovs
+       centos.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
+       centos.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
+       centos.vm.provision "install_rpm", type: "shell", inline: $install_centos_rpm
+  end
 end