From e577f548f926dda095796a612fba4a775e8a6308 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 28 Feb 2022 00:20:26 +0900 Subject: [PATCH] Add support for external_ids:ovn-cms-options This change introduces the new parameter to manage the ovn-cms-options parameter, which is comsumed by the CMS plugin. Change-Id: Ic404a56f341f354d20387c20dbf71a4de28bf122 --- manifests/controller.pp | 12 ++++++++++++ .../notes/ovn-cms-options-2d98e441e752f002.yaml | 4 ++++ spec/classes/ovn_controller_spec.rb | 5 +++++ 3 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/ovn-cms-options-2d98e441e752f002.yaml diff --git a/manifests/controller.pp b/manifests/controller.pp index d047600..397f8e3 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -45,6 +45,11 @@ # (optional) Enable or not DPDK with OVS # Defaults to false. # +# [*ovn_cms_options*] +# (optional) A list of options that will be consumed by the CMS Plugin and +# which specific to this particular chassis. +# Defaults to undef +# # [*ovn_remote_probe_interval*] # (optional) Set probe interval, based on user configuration, value is in ms # Defaults to 60000 @@ -102,6 +107,7 @@ class ovn::controller( $mac_table_size = undef, $datapath_type = undef, $enable_dpdk = false, + $ovn_cms_options = undef, $ovn_remote_probe_interval = 60000, $ovn_openflow_probe_interval = 60, $ovn_transport_zones = [], @@ -143,12 +149,18 @@ class ovn::controller( before => Service['controller'] } + $ovn_cms_options_real = $ovn_cms_options == undef ? { + true => $ovn_cms_options, + default => join(any2array($ovn_cms_options), ',') + } + $config_items = { 'external_ids:ovn-remote' => { 'value' => $ovn_remote }, 'external_ids:ovn-encap-type' => { 'value' => $ovn_encap_type }, 'external_ids:ovn-encap-ip' => { 'value' => $ovn_encap_ip }, 'external_ids:hostname' => { 'value' => $hostname }, 'external_ids:ovn-bridge' => { 'value' => $ovn_bridge }, + 'external_ids:ovn-cms-options' => { 'value' => $ovn_cms_options_real }, 'external_ids:ovn-remote-probe-interval' => { 'value' => "${ovn_remote_probe_interval}" }, 'external_ids:ovn-openflow-probe-interval' => { 'value' => "${ovn_openflow_probe_interval}" }, 'external_ids:ovn-monitor-all' => { 'value' => "${ovn_monitor_all}" }, diff --git a/releasenotes/notes/ovn-cms-options-2d98e441e752f002.yaml b/releasenotes/notes/ovn-cms-options-2d98e441e752f002.yaml new file mode 100644 index 0000000..9d2e1ab --- /dev/null +++ b/releasenotes/notes/ovn-cms-options-2d98e441e752f002.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``ovn::controller::ovn_cms_options`` parameter has been added. diff --git a/spec/classes/ovn_controller_spec.rb b/spec/classes/ovn_controller_spec.rb index 59b1b94..046684a 100644 --- a/spec/classes/ovn_controller_spec.rb +++ b/spec/classes/ovn_controller_spec.rb @@ -10,6 +10,7 @@ describe 'ovn::controller' do :ovn_bridge => 'br-int', :bridge_interface_mappings => ['br-1:eth1'], :hostname => 'server1.example.com', + :ovn_cms_options => ['cms_option1', 'cms_option2:foo'], :ovn_remote_probe_interval => 30000, :ovn_openflow_probe_interval => 8, :ovn_monitor_all => true, @@ -68,6 +69,10 @@ describe 'ovn::controller' do :value => params[:ovn_bridge], ) + is_expected.to contain_vs_config('external_ids:ovn-cms-options').with( + :value => 'cms_option1,cms_option2:foo', + ) + is_expected.to contain_vs_config('external_ids:ovn-remote-probe-interval').with( :value => params[:ovn_remote_probe_interval], )