Merge "Support arbitary vsiwtch configurations"

This commit is contained in:
Zuul 2021-04-27 10:44:21 +00:00 committed by Gerrit Code Review
commit a16a047b45
3 changed files with 31 additions and 1 deletions

View File

@ -49,6 +49,13 @@
# [*handler_cores*]
# (Optional) Number of cores to be used for OVS handler threads.
#
# [*vs_config*]
# (optional) allow configuration of arbitary vsiwtch configurations.
# The value is an hash of vs_config resources. Example:
# { 'other_config:foo' => { value => 'baa' } }
# NOTE: that the configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
# DEPRECATED PARAMETERS
#
# [*driver_type*]
@ -67,11 +74,13 @@ class vswitch::dpdk (
$vlan_limit = $::os_service_default,
$revalidator_cores = undef,
$handler_cores = undef,
$vs_config = {},
# DEPRECATED PARAMETERS
$driver_type = 'vfio-pci',
) {
include vswitch::params
validate_legacy(Hash, 'validate_hash', $vs_config)
kmod::load { 'vfio-pci': }
if $::osfamily != 'Redhat' {
@ -146,5 +155,7 @@ class vswitch::dpdk (
name => $::vswitch::params::ovs_service_name,
}
create_resources ('vs_config', $dpdk_configs, $dpdk_dependencies)
create_resources('vs_config', $dpdk_configs, $dpdk_dependencies)
create_resources('vs_config', $vs_config)
}

View File

@ -33,15 +33,24 @@
# (optional) Number of vlan layers allowed.
# Default to $::os_service_default
#
# [*vs_config*]
# (optional) allow configuration of arbitary vsiwtch configurations.
# The value is an hash of vs_config resources. Example:
# { 'other_config:foo' => { value => 'baa' } }
# NOTE: that the configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
class vswitch::ovs(
$package_ensure = 'present',
$dkms_ensure = false,
$enable_hw_offload = false,
$disable_emc = false,
$vlan_limit = $::os_service_default,
$vs_config = {},
) {
include vswitch::params
validate_legacy(Hash, 'validate_hash', $vs_config)
case $::osfamily {
'Debian': {
@ -102,6 +111,8 @@ class vswitch::ovs(
}
}
create_resources('vs_config', $vs_config)
service { 'openvswitch':
ensure => true,
enable => true,

View File

@ -0,0 +1,8 @@
---
features:
- |
The following two parameters have been added. These two parameters support
arbitary vswitch configurations using hashes.
- ``vswitch::ovs::vs_config``
- ``vswitch::dpdk::vs_config``