From 5ea0dce609e277c439d1cdbd32786ed0e7cd0be4 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 29 Nov 2022 12:26:11 +0900 Subject: [PATCH] Support [DEFAULT] l3_ha_network_* options This change introduces support for a few new parameters so that users can configure these parameters to customize the l3 ha network. Change-Id: Ifa92f37041c76d80b74769eae06d061b546c49d8 --- manifests/server.pp | 14 +++++++++++ .../notes/l3-opts-16b17ace694d9c59.yaml | 8 +++++++ spec/classes/neutron_server_spec.rb | 24 +++++++++++++++++-- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/l3-opts-16b17ace694d9c59.yaml diff --git a/manifests/server.pp b/manifests/server.pp index a29255ce2..b14487612 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -164,6 +164,16 @@ # (Optional) CIDR of the administrative network if HA mode is enabled. # Defaults to $::os_service_default # +# [*l3_ha_network_type*] +# (Optional) The network type to use when creating the HA network for an HA +# router. +# Defaults to $::os_service_default +# +# [*l3_ha_network_physical_name*] +# (Optional) The physical network name with which the HA network can be +# created. +# Defaults to $::os_service_default +# # [*network_auto_schedule*] # (Optional) Allow auto scheduling networks to DHCP agent # Defaults to $::os_service_default. @@ -259,6 +269,8 @@ class neutron::server ( $l3_ha = false, $max_l3_agents_per_router = 3, $l3_ha_net_cidr = $::os_service_default, + $l3_ha_network_type = $::os_service_default, + $l3_ha_network_physical_name = $::os_service_default, $network_auto_schedule = $::os_service_default, $ensure_vpnaas_package = false, $ensure_dr_package = false, @@ -329,6 +341,8 @@ class neutron::server ( 'DEFAULT/l3_ha': value => $l3_ha; 'DEFAULT/max_l3_agents_per_router': value => $max_l3_agents_per_router; 'DEFAULT/l3_ha_net_cidr': value => $l3_ha_net_cidr; + 'DEFAULT/l3_ha_network_type': value => $l3_ha_network_type; + 'DEFAULT/l3_ha_network_physical_name': value => $l3_ha_network_physical_name; 'DEFAULT/api_workers': value => $api_workers; 'DEFAULT/rpc_workers': value => $rpc_workers; 'DEFAULT/rpc_state_report_workers': value => $rpc_state_report_workers; diff --git a/releasenotes/notes/l3-opts-16b17ace694d9c59.yaml b/releasenotes/notes/l3-opts-16b17ace694d9c59.yaml new file mode 100644 index 000000000..1c703e2b7 --- /dev/null +++ b/releasenotes/notes/l3-opts-16b17ace694d9c59.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The following two parameters have been added to the ``neutron::server`` + class. + + - ``l3_ha_network_type`` + - ``l3_ha_network_physical_name`` diff --git a/spec/classes/neutron_server_spec.rb b/spec/classes/neutron_server_spec.rb index 08393fc95..bb471ea93 100644 --- a/spec/classes/neutron_server_spec.rb +++ b/spec/classes/neutron_server_spec.rb @@ -138,6 +138,8 @@ describe 'neutron::server' do should contain_neutron_config('DEFAULT/l3_ha').with_value(true) should contain_neutron_config('DEFAULT/max_l3_agents_per_router').with_value(3) should contain_neutron_config('DEFAULT/l3_ha_net_cidr').with_value('') + should contain_neutron_config('DEFAULT/l3_ha_network_type').with_value('') + should contain_neutron_config('DEFAULT/l3_ha_network_physical_name').with_value('') end end @@ -150,13 +152,17 @@ describe 'neutron::server' do should contain_neutron_config('DEFAULT/l3_ha').with_value(false) should contain_neutron_config('DEFAULT/max_l3_agents_per_router').with_value(3) should contain_neutron_config('DEFAULT/l3_ha_net_cidr').with_value('') + should contain_neutron_config('DEFAULT/l3_ha_network_type').with_value('') + should contain_neutron_config('DEFAULT/l3_ha_network_physical_name').with_value('') end end context 'with HA routers enabled with unlimited l3 agents per router' do before :each do - params.merge!(:l3_ha => true, - :max_l3_agents_per_router => 0 ) + params.merge!({ + :l3_ha => true, + :max_l3_agents_per_router => 0 + }) end it 'should enable HA routers' do @@ -164,6 +170,20 @@ describe 'neutron::server' do end end + context 'with HA routers options' do + before :each do + params.merge!({ + :l3_ha_network_type => 'vlan', + :l3_ha_network_physical_name => 'datacentre' + }) + end + + it 'should configure the HA routers options' do + should contain_neutron_config('DEFAULT/l3_ha_network_type').with_value('vlan') + should contain_neutron_config('DEFAULT/l3_ha_network_physical_name').with_value('datacentre') + end + end + context 'with allow_automatic_l3agent_failover in neutron.conf' do it 'should configure allow_automatic_l3agent_failover' do should contain_neutron_config('DEFAULT/allow_automatic_l3agent_failover').with_value('')