Separate OVS kernel module name for Ubuntu 14.xx and ubuntu 16.xx

Change-Id: I7a1644073093306338a948cd3f609c50160868e2
Related-bug: #1587084
This commit is contained in:
Sergey Vasilenko 2016-06-09 14:14:53 +03:00
parent 91a3612147
commit b94b6f6a43
6 changed files with 98 additions and 43 deletions

View File

@ -58,7 +58,6 @@ class l23network (
$modprobe_8021q = undef, $modprobe_8021q = undef,
$install_ethtool = undef, $install_ethtool = undef,
$ovs_module_name = $::l23network::params::ovs_kern_module_name, $ovs_module_name = $::l23network::params::ovs_kern_module_name,
$use_ovs_dkms_datapath_module = true,
$ovs_datapath_package_name = $::l23network::params::ovs_datapath_package_name, $ovs_datapath_package_name = $::l23network::params::ovs_datapath_package_name,
$ovs_common_package_name = $::l23network::params::ovs_common_package_name, $ovs_common_package_name = $::l23network::params::ovs_common_package_name,
$disable_hotplug = true, $disable_hotplug = true,
@ -81,7 +80,6 @@ class l23network (
modprobe_8021q => pick($modprobe_8021q, $use_lnx), modprobe_8021q => pick($modprobe_8021q, $use_lnx),
install_ethtool => pick($install_ethtool, $use_lnx), install_ethtool => pick($install_ethtool, $use_lnx),
ovs_module_name => $ovs_module_name, ovs_module_name => $ovs_module_name,
use_ovs_dkms_datapath_module => $use_ovs_dkms_datapath_module,
ovs_datapath_package_name => $ovs_datapath_package_name, ovs_datapath_package_name => $ovs_datapath_package_name,
ovs_common_package_name => $ovs_common_package_name, ovs_common_package_name => $ovs_common_package_name,
dpdk_options => $dpdk_options, dpdk_options => $dpdk_options,

View File

@ -36,7 +36,6 @@ class l23network::l2 (
$modprobe_8021q = undef, $modprobe_8021q = undef,
$install_ethtool = undef, $install_ethtool = undef,
$ovs_module_name = $::l23network::params::ovs_kern_module_name, $ovs_module_name = $::l23network::params::ovs_kern_module_name,
$use_ovs_dkms_datapath_module = true,
$ovs_datapath_package_name = $::l23network::params::ovs_datapath_package_name, $ovs_datapath_package_name = $::l23network::params::ovs_datapath_package_name,
$ovs_common_package_name = $::l23network::params::ovs_common_package_name, $ovs_common_package_name = $::l23network::params::ovs_common_package_name,
$dpdk_options = {}, $dpdk_options = {},
@ -47,7 +46,7 @@ class l23network::l2 (
$_install_ovs = pick($install_ovs, $use_ovs) $_install_ovs = pick($install_ovs, $use_ovs)
if $_install_ovs { if $_install_ovs {
if $use_ovs_dkms_datapath_module { if $ovs_datapath_package_name {
package { 'openvswitch-datapath': package { 'openvswitch-datapath':
ensure => $ensure_package, ensure => $ensure_package,
name => $ovs_datapath_package_name, name => $ovs_datapath_package_name,

View File

@ -14,7 +14,10 @@ class l23network::params {
$lnx_bond_tools = 'ifenslave' $lnx_bond_tools = 'ifenslave'
$lnx_ethernet_tools = 'ethtool' $lnx_ethernet_tools = 'ethtool'
$lnx_bridge_tools = 'bridge-utils' $lnx_bridge_tools = 'bridge-utils'
$ovs_datapath_package_name = 'openvswitch-datapath-dkms' $ovs_datapath_package_name = $::operatingsystemmajrelease ? {
/^14\./ =>'openvswitch-datapath-dkms',
default => undef
}
$ovs_common_package_name = 'openvswitch-switch' $ovs_common_package_name = 'openvswitch-switch'
$ovs_dpdk_package_name = 'openvswitch-switch-dpdk' $ovs_dpdk_package_name = 'openvswitch-switch-dpdk'
$ovs_dpdk_dkms_package_name = 'dpdk-dkms' $ovs_dpdk_dkms_package_name = 'dpdk-dkms'

View File

@ -99,7 +99,7 @@ describe 'l23network::l2' do
{ :ensure_package => 'present', { :ensure_package => 'present',
:use_lnx => true, :use_lnx => true,
:use_ovs => true, :use_ovs => true,
:use_ovs_dkms_datapath_module => false, :ovs_datapath_package_name => nil,
} }
end end
@ -149,10 +149,11 @@ describe 'l23network::l2' do
end end
context 'Ubuntu' do context 'Ubuntu-14.04' do
let (:facts) do let (:facts) do
{ :l23_os => 'ubuntu', { :l23_os => 'ubuntu',
:l3_fqdn_hostname => 'my_name', :l3_fqdn_hostname => 'my_name',
:operatingsystemmajrelease => '14.04'
} }
end end
@ -241,29 +242,6 @@ describe 'l23network::l2' do
end end
context 'use_ovs with disabled dkms ovs module' do
let :params do
{ :ensure_package => 'present',
:use_lnx => true,
:use_ovs => true,
:use_ovs_dkms_datapath_module => false,
}
end
it { should compile.with_all_deps }
it { should_not contain_package('openvswitch-datapath').with_name('openvswitch-datapath-dkms') }
it { should contain_package('openvswitch-common').with_name('openvswitch-switch') }
it { should contain_package('openvswitch-common').that_notifies('Service[openvswitch-service]') }
it { should contain_service('openvswitch-service') }
it { should contain_k_mod('openvswitch').with_ensure('present') }
end
context 'use_ovs, use_dpdk with default parameters' do context 'use_ovs, use_dpdk with default parameters' do
let :params do let :params do
@ -303,5 +281,72 @@ describe 'l23network::l2' do
end end
context 'Ubuntu-16.04' do
let (:facts) do
{ :l23_os => 'ubuntu',
:l3_fqdn_hostname => 'my_name',
:operatingsystemmajrelease => '16.04'
}
end
let :pre_condition do
'K_mod <| |>'
end
puppet_debug_override
context 'with a default params' do
let :params do
{
:modprobe_bonding => true,
:modprobe_8021q => true,
:modprobe_bridge => true,
}
end
it { should compile.with_all_deps }
it { should_not contain_package('openvswitch-datapath') }
it { should_not contain_package('openvswitch-common') }
it { should_not contain_package('openvswitch-dpdk').with_name('openvswitch-switch-dpdk') }
it { should_not contain_service('openvswitch-service') }
it { should_not contain_service('dpdk') }
it { should_not contain_k_mod('openvswitch').with_ensure('present') }
it { should contain_k_mod('bonding') }
it { should contain_k_mod('8021q') }
it { should contain_k_mod('bridge') }
end
context 'use_ovs with default parameters' do
let :params do
{ :ensure_package => 'present',
:use_lnx => true,
:use_ovs => true,
}
end
it { should compile.with_all_deps }
it { should_not contain_package('openvswitch-datapath').with_name('openvswitch-datapath-dkms') }
it { should_not contain_package('openvswitch-datapath').that_comes_before('Service[openvswitch-service]') }
it { should contain_package('openvswitch-common').with_name('openvswitch-switch') }
it { should contain_package('openvswitch-common').that_notifies('Service[openvswitch-service]') }
it { should contain_service('openvswitch-service') }
it { should contain_k_mod('openvswitch').with_ensure('present') }
end
end
end end

View File

@ -7,17 +7,24 @@ class osnailyfacter::netconfig::configure_default_route {
$management_role = 'management' $management_role = 'management'
$fw_admin_role = 'fw-admin' $fw_admin_role = 'fw-admin'
if ( $::l23_os =~ /(?i:centos6)/ and $::kernelmajversion == '3.10' ) { $dpdk_options = hiera_hash('dpdk', {})
if ($::l23_os =~ /(?i:redhat7|centos7)/) {
# do not install
$ovs_datapath_package_name = false
} elsif $::l23_os =~ /(?i:centos6)/ and $::kernelmajversion == '3.10' {
# install more specific version for Centos6 AND 3.10 kernel
$ovs_datapath_package_name = 'kmod-openvswitch-lt' $ovs_datapath_package_name = 'kmod-openvswitch-lt'
} else {
# do not change default behavior
$ovs_datapath_package_name = undef
} }
class { '::l23network' : class { '::l23network' :
use_ovs => hiera('use_ovs', false), use_ovs => hiera('use_ovs', false),
use_ovs_dkms_datapath_module => $::l23_os ? {
/(?i:redhat7|centos7|oraclelinux7)/ => false,
default => true
},
ovs_datapath_package_name => $ovs_datapath_package_name, ovs_datapath_package_name => $ovs_datapath_package_name,
use_dpdk => pick($dpdk_options['enabled'], false),
dpdk_options => $dpdk_options,
} }
$new_network_scheme = configure_default_route($network_scheme, $management_vrouter_vip, $fw_admin_role, $management_role ) $new_network_scheme = configure_default_route($network_scheme, $management_vrouter_vip, $fw_admin_role, $management_role )

View File

@ -5,18 +5,21 @@ class osnailyfacter::netconfig::netconfig {
$network_scheme = hiera_hash('network_scheme', {}) $network_scheme = hiera_hash('network_scheme', {})
prepare_network_config($network_scheme) prepare_network_config($network_scheme)
if ( $::l23_os =~ /(?i:centos6)/ and $::kernelmajversion == '3.10' ) {
$ovs_datapath_package_name = 'kmod-openvswitch-lt'
}
$dpdk_options = hiera_hash('dpdk', {}) $dpdk_options = hiera_hash('dpdk', {})
if ($::l23_os =~ /(?i:redhat7|centos7)/) {
# do not install
$ovs_datapath_package_name = false
} elsif $::l23_os =~ /(?i:centos6)/ and $::kernelmajversion == '3.10' {
# install more specific version for Centos6 AND 3.10 kernel
$ovs_datapath_package_name = 'kmod-openvswitch-lt'
} else {
# do not change default behavior
$ovs_datapath_package_name = undef
}
class { '::l23network' : class { '::l23network' :
use_ovs => hiera('use_ovs', false), use_ovs => hiera('use_ovs', false),
use_ovs_dkms_datapath_module => $::l23_os ? {
/(?i:redhat7|centos7)/ => false,
default => true
},
ovs_datapath_package_name => $ovs_datapath_package_name, ovs_datapath_package_name => $ovs_datapath_package_name,
use_dpdk => pick($dpdk_options['enabled'], false), use_dpdk => pick($dpdk_options['enabled'], false),
dpdk_options => $dpdk_options, dpdk_options => $dpdk_options,