Add support for n-server to manage n-d-r package

When enabling 'bgp' in the service_plugins neutron-server
will try to start and load the bgp service plugin but if
the neutron-dynamic-routing package is not there it will
fail to start.

This adds a mechanism to enable installation of the n-d-r
packages by setting the enable_dr_package in neutron::server
same as done for VPNaaS, LBaaS etc.

Depends-On: https://review.openstack.org/#/c/583262/
Change-Id: I8a50f36ea3e824ebd959e627e0de90cd28ec4e56
This commit is contained in:
Tobias Urdin 2018-07-27 09:45:44 +02:00
parent c774cb1ca3
commit ef6d25c2fd
2 changed files with 49 additions and 0 deletions

View File

@ -202,6 +202,11 @@
# Set to true to ensure installation of the package that is required to start neutron service if service_plugin is enabled.
# Defaults to false.
#
# [*ensure_dr_package*]
# (Optional) Ensures installation of Neutron Dynamic Routing package before starting API service.
# Set to true to ensure installation of the package that is required to start neutron service if bgp service_plugin is enabled.
# Defaults to false.
#
# [*vpnaas_agent_package*]
# (Optional) Use VPNaaS agent package instead of L3 agent package on debian platforms
# RedHat platforms won't take care of this parameter
@ -273,6 +278,7 @@ class neutron::server (
$network_auto_schedule = $::os_service_default,
$ensure_vpnaas_package = false,
$ensure_fwaas_package = false,
$ensure_dr_package = false,
$vpnaas_agent_package = false,
$service_providers = $::os_service_default,
$auth_strategy = 'keystone',
@ -334,6 +340,25 @@ class neutron::server (
})
}
if $ensure_dr_package {
if $::neutron::params::dynamic_routing_package {
ensure_packages('neutron-dynamic-routing', {
ensure => $package_ensure,
name => $::neutron::params::dynamic_routing_package,
tag => ['openstack', 'neutron-package'],
})
} elsif $::neutron::params::bgp_dragent_package {
# RedHat package doesn't ship dynamic-routing package separately
# so we install the agent, it's fine because RedHat based doesn't
# start services automatically like Debian based.
ensure_packages('neutron-bgp-dragent', {
ensure => $package_ensure,
name => $::neutron::params::bgp_dragent_package,
tag => ['openstack', 'neutron-package'],
})
}
}
if $sync_db {
include ::neutron::db::sync
}

View File

@ -273,6 +273,28 @@ describe 'neutron::server' do
end
end
shared_examples_for 'neutron server dynamic routing debian' do
before do
params.merge!( :ensure_dr_package => true )
end
it 'should install dynamic routing package' do
is_expected.to contain_package('neutron-dynamic-routing')
is_expected.not_to contain_package('neutron-bgp-dragent')
end
end
shared_examples_for 'neutron server dynamic routing redhat' do
before do
params.merge!( :ensure_dr_package => true )
end
it 'should install bgp dragent package' do
is_expected.not_to contain_package('neutron-dynamic-routing')
is_expected.to contain_package('neutron-bgp-dragent')
end
end
shared_examples_for 'a neutron server without database synchronization' do
before do
params.merge!(
@ -298,6 +320,7 @@ describe 'neutron::server' do
it_configures 'a neutron server'
it_configures 'a neutron server without database synchronization'
it_configures 'neutron server dynamic routing debian'
end
context 'on RedHat platforms' do
@ -314,5 +337,6 @@ describe 'neutron::server' do
it_configures 'a neutron server'
it_configures 'a neutron server without database synchronization'
it_configures 'neutron server dynamic routing redhat'
end
end