From 054a60c360f6ef9a06c146131f502444b8a9f0d0 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 23 Aug 2022 23:35:45 +0900 Subject: [PATCH] Add support for external_ids:ovn-encap-tos ... which is available since v21.12.0[1]. [1] https://github.com/ovn-org/ovn/commit/9f2eb5cdb6d67fc8c7e6f477bc4bdc94cfbca028 Change-Id: I33931579b15a1629007dbe3a3d48433739b0ce56 --- manifests/controller.pp | 20 ++++++++++++++++++- .../notes/ovn-encap-tos-bd7bd9b3e3d19cc3.yaml | 5 +++++ spec/classes/ovn_controller_spec.rb | 5 +++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/ovn-encap-tos-bd7bd9b3e3d19cc3.yaml diff --git a/manifests/controller.pp b/manifests/controller.pp index 99dfba4..cb148cd 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -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 : # 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'] } diff --git a/releasenotes/notes/ovn-encap-tos-bd7bd9b3e3d19cc3.yaml b/releasenotes/notes/ovn-encap-tos-bd7bd9b3e3d19cc3.yaml new file mode 100644 index 0000000..42a68b9 --- /dev/null +++ b/releasenotes/notes/ovn-encap-tos-bd7bd9b3e3d19cc3.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``ovn::controller::encap_tos`` parameter has been added. This + parameter controls the ``ovn-encap-tos`` external id. diff --git a/spec/classes/ovn_controller_spec.rb b/spec/classes/ovn_controller_spec.rb index fd821b7..7cff1d0 100644 --- a/spec/classes/ovn_controller_spec.rb +++ b/spec/classes/ovn_controller_spec.rb @@ -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], )