Add support for external_ids:ovn-encap-tos

... which is available since v21.12.0[1].

[1] 9f2eb5cdb6

Change-Id: I33931579b15a1629007dbe3a3d48433739b0ce56
This commit is contained in:
Takashi Kajinami 2022-08-23 23:35:45 +09:00
parent 59ffa355e9
commit 054a60c360
3 changed files with 29 additions and 1 deletions

View File

@ -17,6 +17,10 @@
# (Required) IP address of the hypervisor(in which this module is installed) to which
# the other controllers would use to create a tunnel to this controller
#
# [*ovn_encap_tos*]
# (Optional) The value to be applied to OVN tunnel interface's option:tos.
# Defaults to undef
#
# [*ovn_bridge_mappings*]
# (optional) List of <ovn-network-name>:<bridge-name>
# Defaults to empty list
@ -100,6 +104,7 @@ class ovn::controller(
$ovn_remote,
$ovn_encap_ip,
$ovn_encap_type = 'geneve',
$ovn_encap_tos = undef,
$ovn_bridge_mappings = [],
$bridge_interface_mappings = [],
$hostname = $::fqdn,
@ -166,6 +171,16 @@ class ovn::controller(
'external_ids:ovn-monitor-all' => { 'value' => $ovn_monitor_all },
}
if $ovn_encap_tos {
$encap_tos = {
'external_ids:ovn-encap-tos' => { 'value' => $ovn_encap_tos }
}
} else {
$encap_tos = {
'external_ids:ovn-encap-tos' => { 'ensure' => 'absent' }
}
}
if !empty($ovn_chassis_mac_map) {
if $ovn_chassis_mac_map =~ Hash {
$chassis_mac_map = {
@ -230,6 +245,9 @@ class ovn::controller(
$ovn_match_northd = {
'external_ids:ovn-match-northd-version' => { 'value' => $enable_ovn_match_northd }
}
create_resources('vs_config', merge($config_items, $chassis_mac_map, $bridge_items, $tz_items, $datapath_config, $ovn_match_northd))
create_resources(
'vs_config',
merge($config_items, $encap_tos, $chassis_mac_map, $bridge_items, $tz_items, $datapath_config, $ovn_match_northd)
)
Service['openvswitch'] -> Vs_config<||> -> Service['controller']
}

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``ovn::controller::encap_tos`` parameter has been added. This
parameter controls the ``ovn-encap-tos`` external id.

View File

@ -6,6 +6,7 @@ describe 'ovn::controller' do
{ :ovn_remote => 'tcp:x.x.x.x:5000',
:ovn_encap_type => 'geneve',
:ovn_encap_ip => '1.2.3.4',
:ovn_encap_tos => 0,
:ovn_bridge_mappings => ['physnet-1:br-1'],
:ovn_bridge => 'br-int',
:bridge_interface_mappings => ['br-1:eth1'],
@ -73,6 +74,10 @@ describe 'ovn::controller' do
:value => 'cms_option1,cms_option2:foo',
)
is_expected.to contain_vs_config('external_ids:ovn-encap-tos').with(
:value => 0,
)
is_expected.to contain_vs_config('external_ids:ovn-remote-probe-interval').with(
:value => params[:ovn_remote_probe_interval],
)