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
This commit is contained in:
Takashi Kajinami 2022-11-29 12:26:11 +09:00
parent 8011bfcab1
commit 5ea0dce609
3 changed files with 44 additions and 2 deletions

View File

@ -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;

View File

@ -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``

View File

@ -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('<SERVICE DEFAULT>')
should contain_neutron_config('DEFAULT/l3_ha_network_type').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('DEFAULT/l3_ha_network_physical_name').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
should contain_neutron_config('DEFAULT/l3_ha_network_type').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('DEFAULT/l3_ha_network_physical_name').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')