Merge "CentOS: Install only bgpvpn plugin package in neutron-server"
This commit is contained in:
commit
130b2003b0
@ -69,20 +69,10 @@ class neutron::agents::bgp_dragent(
|
||||
'bgp/bgp_router_id': value => $bgp_router_id;
|
||||
}
|
||||
|
||||
if $::neutron::params::dynamic_routing_package {
|
||||
ensure_packages('neutron-dynamic-routing', {
|
||||
ensure => $package_ensure,
|
||||
name => $::neutron::params::dynamic_routing_package,
|
||||
tag => ['openstack', 'neutron-package'],
|
||||
})
|
||||
}
|
||||
|
||||
if $::neutron::params::bgp_dragent_package {
|
||||
ensure_packages('neutron-bgp-dragent', {
|
||||
ensure => $package_ensure,
|
||||
name => $::neutron::params::bgp_dragent_package,
|
||||
tag => ['openstack', 'neutron-package'],
|
||||
})
|
||||
package { 'neutron-bgp-dragent':
|
||||
ensure => $package_ensure,
|
||||
name => $::neutron::params::bgp_dragent_package,
|
||||
tag => ['openstack', 'neutron-package'],
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
|
@ -53,7 +53,7 @@ class neutron::params {
|
||||
$l2gw_package = 'python3-networking-l2gw'
|
||||
$ovn_metadata_agent_package = 'openstack-neutron-ovn-metadata-agent'
|
||||
$ovn_agent_package = 'openstack-neutron-ovn-agent'
|
||||
$dynamic_routing_package = false
|
||||
$dynamic_routing_package = 'python3-neutron-dynamic-routing'
|
||||
$bgp_dragent_package = 'openstack-neutron-bgp-dragent'
|
||||
$openswan_package = 'libreswan'
|
||||
$libreswan_package = 'libreswan'
|
||||
|
@ -301,7 +301,7 @@ class neutron::server (
|
||||
}
|
||||
|
||||
if $ensure_vpnaas_package {
|
||||
ensure_resource( 'package', 'neutron-vpnaas-agent', {
|
||||
ensure_packages( 'neutron-vpnaas-agent', {
|
||||
'ensure' => $package_ensure,
|
||||
'name' => $::neutron::params::vpnaas_agent_package,
|
||||
'tag' => ['openstack', 'neutron-package'],
|
||||
@ -309,22 +309,11 @@ 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'],
|
||||
})
|
||||
}
|
||||
ensure_packages('neutron-dynamic-routing', {
|
||||
ensure => $package_ensure,
|
||||
name => $::neutron::params::dynamic_routing_package,
|
||||
tag => ['openstack', 'neutron-package'],
|
||||
})
|
||||
}
|
||||
|
||||
if $sync_db {
|
||||
|
@ -19,10 +19,7 @@ require 'spec_helper'
|
||||
describe 'neutron::agents::bgp_dragent' do
|
||||
let :default_params do
|
||||
{
|
||||
:package_ensure => 'installed',
|
||||
:enabled => true,
|
||||
:bgp_speaker_driver => 'neutron_dynamic_routing.services.bgp.agent.driver.os_ken.driver.OsKenBgpDriver',
|
||||
:purge_config => false,
|
||||
}
|
||||
end
|
||||
|
||||
@ -35,166 +32,39 @@ describe 'neutron::agents::bgp_dragent' do
|
||||
it { should contain_class('neutron::deps') }
|
||||
it { should contain_class('neutron::params') }
|
||||
|
||||
it { should contain_resources('neutron_bgp_dragent_config').with_purge(default_params[:purge_config]) }
|
||||
it { should contain_resources('neutron_bgp_dragent_config').with_purge(false) }
|
||||
|
||||
it { should contain_neutron_bgp_dragent_config('bgp/bgp_speaker_driver').with_value(default_params[:bgp_speaker_driver]) }
|
||||
it { should contain_neutron_bgp_dragent_config('bgp/bgp_router_id').with_value(facts[:networking]['ip']) }
|
||||
|
||||
it { should contain_package('neutron-bgp-dragent').with(
|
||||
:ensure => 'present',
|
||||
:name => platform_params[:bgp_dragent_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_service('neutron-bgp-dragent').with(
|
||||
:ensure => 'running',
|
||||
:name => platform_params[:bgp_dragent_service],
|
||||
:enable => true,
|
||||
:tag => 'neutron-service',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with overridden params' do
|
||||
before do
|
||||
params.merge!( :bgp_speaker_driver => 'FakeDriver',
|
||||
:bgp_router_id => '4.3.2.1',
|
||||
:purge_config => true )
|
||||
params.merge!(
|
||||
:package_ensure => 'absent',
|
||||
:enabled => false,
|
||||
:bgp_speaker_driver => 'FakeDriver',
|
||||
:bgp_router_id => '4.3.2.1',
|
||||
:purge_config => true
|
||||
)
|
||||
end
|
||||
|
||||
it { should contain_resources('neutron_bgp_dragent_config').with_purge(true) }
|
||||
it { should contain_neutron_bgp_dragent_config('bgp/bgp_speaker_driver').with_value('FakeDriver') }
|
||||
it { should contain_neutron_bgp_dragent_config('bgp/bgp_router_id').with_value('4.3.2.1') }
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'neutron::agents::bgp_dragent on RedHat' do
|
||||
context 'with default params' do
|
||||
it { should_not contain_package('neutron-dynamic-routing') }
|
||||
|
||||
it { should contain_package('neutron-bgp-dragent').with(
|
||||
:ensure => default_params[:package_ensure],
|
||||
:name => platform_params[:bgp_dragent_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_service('neutron-bgp-dragent').with(
|
||||
:ensure => 'running',
|
||||
:name => platform_params[:bgp_dragent_service],
|
||||
:enable => default_params[:enabled],
|
||||
:tag => 'neutron-service',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with overridden params' do
|
||||
before do
|
||||
params.merge!( :package_ensure => 'absent',
|
||||
:enabled => false )
|
||||
end
|
||||
|
||||
it { should_not contain_package('neutron-dynamic-routing') }
|
||||
|
||||
it { should contain_package('neutron-bgp-dragent').with(
|
||||
:ensure => 'absent',
|
||||
:name => platform_params[:bgp_dragent_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_service('neutron-bgp-dragent').with(
|
||||
:ensure => 'stopped',
|
||||
:name => platform_params[:bgp_dragent_service],
|
||||
:enable => false,
|
||||
:tag => 'neutron-service',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with manage_service as false' do
|
||||
before :each do
|
||||
params.merge!(:manage_service => false)
|
||||
end
|
||||
it 'should not manage the service' do
|
||||
should_not contain_service('neutron-bgp-dragent')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'neutron::agents::bgp_dragent on Debian' do
|
||||
context 'with default params' do
|
||||
it { should contain_package('neutron-dynamic-routing').with(
|
||||
:ensure => default_params[:package_ensure],
|
||||
:name => platform_params[:dynamic_routing_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_package('neutron-bgp-dragent').with(
|
||||
:ensure => default_params[:package_ensure],
|
||||
:name => platform_params[:bgp_dragent_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_service('neutron-bgp-dragent').with(
|
||||
:ensure => 'running',
|
||||
:name => platform_params[:bgp_dragent_service],
|
||||
:enable => default_params[:enabled],
|
||||
:tag => 'neutron-service',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with overridden params' do
|
||||
before do
|
||||
params.merge!( :package_ensure => 'absent',
|
||||
:enabled => false )
|
||||
end
|
||||
|
||||
it { should contain_package('neutron-dynamic-routing').with(
|
||||
:ensure => 'absent',
|
||||
:name => platform_params[:dynamic_routing_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_package('neutron-bgp-dragent').with(
|
||||
:ensure => 'absent',
|
||||
:name => platform_params[:bgp_dragent_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_service('neutron-bgp-dragent').with(
|
||||
:ensure => 'stopped',
|
||||
:name => platform_params[:bgp_dragent_service],
|
||||
:enable => false,
|
||||
:tag => 'neutron-service',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with manage_service as false' do
|
||||
before :each do
|
||||
params.merge!(:manage_service => false)
|
||||
end
|
||||
it 'should not manage the service' do
|
||||
should_not contain_service('neutron-bgp-dragent')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'neutron::agents::bgp_dragent on Ubuntu' do
|
||||
context 'with default params' do
|
||||
it { should contain_package('neutron-dynamic-routing').with(
|
||||
:ensure => default_params[:package_ensure],
|
||||
:name => platform_params[:dynamic_routing_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_package('neutron-bgp-dragent').with(
|
||||
:ensure => default_params[:package_ensure],
|
||||
:name => platform_params[:bgp_dragent_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_service('neutron-bgp-dragent').with(
|
||||
:ensure => 'running',
|
||||
:name => platform_params[:bgp_dragent_service],
|
||||
:enable => default_params[:enabled],
|
||||
:tag => 'neutron-service',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with overridden params' do
|
||||
before do
|
||||
params.merge!( :package_ensure => 'absent',
|
||||
:enabled => false )
|
||||
end
|
||||
|
||||
it { should contain_package('neutron-dynamic-routing').with(
|
||||
:ensure => 'absent',
|
||||
:name => platform_params[:dynamic_routing_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)}
|
||||
|
||||
it { should contain_package('neutron-bgp-dragent').with(
|
||||
:ensure => 'absent',
|
||||
@ -232,27 +102,18 @@ describe 'neutron::agents::bgp_dragent' do
|
||||
case facts[:os]['family']
|
||||
when 'RedHat'
|
||||
{
|
||||
:dynamic_routing_package => false,
|
||||
:bgp_dragent_package => 'openstack-neutron-bgp-dragent',
|
||||
:bgp_dragent_service => 'neutron-bgp-dragent',
|
||||
:bgp_dragent_package => 'openstack-neutron-bgp-dragent',
|
||||
:bgp_dragent_service => 'neutron-bgp-dragent',
|
||||
}
|
||||
when 'Debian'
|
||||
{
|
||||
:dynamic_routing_package => 'python3-neutron-dynamic-routing',
|
||||
:bgp_dragent_package => 'neutron-bgp-dragent',
|
||||
:bgp_dragent_service => 'neutron-bgp-dragent',
|
||||
:bgp_dragent_package => 'neutron-bgp-dragent',
|
||||
:bgp_dragent_service => 'neutron-bgp-dragent',
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'neutron::agents::bgp_dragent'
|
||||
|
||||
case facts[:os]['family']
|
||||
when 'RedHat'
|
||||
it_behaves_like 'neutron::agents::bgp_dragent on RedHat'
|
||||
when 'Debian'
|
||||
it_behaves_like "neutron::agents::bgp_dragent on #{facts[:os]['name']}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -22,7 +22,7 @@ describe 'neutron::server' do
|
||||
}
|
||||
end
|
||||
|
||||
shared_examples 'a neutron server' do
|
||||
shared_examples 'neutron::server' do
|
||||
let :p do
|
||||
default_params.merge(params)
|
||||
end
|
||||
@ -339,51 +339,46 @@ describe 'neutron::server' do
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
context 'with VPNaaS package installation' do
|
||||
before do
|
||||
params.merge!(
|
||||
:ensure_vpnaas_package => true,
|
||||
)
|
||||
end
|
||||
|
||||
shared_examples 'VPNaaS package installation' do
|
||||
before do
|
||||
params.merge!(
|
||||
:ensure_vpnaas_package => true,
|
||||
)
|
||||
it 'should install VPNaaS package' do
|
||||
should contain_package('neutron-vpnaas-agent').with(
|
||||
:ensure => 'installed',
|
||||
:name => platform_params[:vpnaas_agent_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
it 'should install *aaS packages' do
|
||||
should contain_package('neutron-vpnaas-agent')
|
||||
end
|
||||
end
|
||||
context 'with Dynamic routing package installation' do
|
||||
before do
|
||||
params.merge!( :ensure_dr_package => true )
|
||||
end
|
||||
|
||||
shared_examples 'neutron server dynamic routing on Debian' do
|
||||
before do
|
||||
params.merge!( :ensure_dr_package => true )
|
||||
it 'should install dynamic routing package' do
|
||||
should contain_package('neutron-dynamic-routing').with(
|
||||
:ensure => 'installed',
|
||||
:name => platform_params[:dynamic_routing_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
it 'should install dynamic routing package' do
|
||||
should contain_package('neutron-dynamic-routing')
|
||||
should_not contain_package('neutron-bgp-dragent')
|
||||
end
|
||||
end
|
||||
context 'without database synchronization' do
|
||||
before do
|
||||
params.merge!(
|
||||
:sync_db => true
|
||||
)
|
||||
end
|
||||
|
||||
shared_examples 'neutron server dynamic routing on RedHat' do
|
||||
before do
|
||||
params.merge!( :ensure_dr_package => true )
|
||||
end
|
||||
|
||||
it 'should install bgp dragent package' do
|
||||
should_not contain_package('neutron-dynamic-routing')
|
||||
should contain_package('neutron-bgp-dragent')
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'a neutron server without database synchronization' do
|
||||
before do
|
||||
params.merge!(
|
||||
:sync_db => true
|
||||
)
|
||||
end
|
||||
|
||||
it 'includes neutron::db::sync' do
|
||||
should contain_class('neutron::db::sync')
|
||||
it 'includes neutron::db::sync' do
|
||||
should contain_class('neutron::db::sync')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -400,27 +395,31 @@ describe 'neutron::server' do
|
||||
when 'Debian'
|
||||
if facts[:os]['name'] == 'Ubuntu'
|
||||
{
|
||||
:server_package => 'neutron-server',
|
||||
:server_service => 'neutron-server',
|
||||
:rpc_service_name => 'neutron-rpc-server',
|
||||
:server_package => 'neutron-server',
|
||||
:server_service => 'neutron-server',
|
||||
:rpc_service_name => 'neutron-rpc-server',
|
||||
:dynamic_routing_package => 'python3-neutron-dynamic-routing',
|
||||
:vpnaas_agent_package => 'python3-neutron-vpnaas',
|
||||
}
|
||||
else
|
||||
{
|
||||
:api_service_name => 'neutron-api',
|
||||
:rpc_service_name => 'neutron-rpc-server',
|
||||
:api_service_name => 'neutron-api',
|
||||
:rpc_service_name => 'neutron-rpc-server',
|
||||
:dynamic_routing_package => 'python3-neutron-dynamic-routing',
|
||||
:vpnaas_agent_package => 'python3-neutron-vpnaas',
|
||||
}
|
||||
end
|
||||
when 'RedHat'
|
||||
{
|
||||
:server_service => 'neutron-server',
|
||||
:rpc_service_name => 'neutron-rpc-server',
|
||||
:server_service => 'neutron-server',
|
||||
:rpc_service_name => 'neutron-rpc-server',
|
||||
:dynamic_routing_package => 'python3-neutron-dynamic-routing',
|
||||
:vpnaas_agent_package => 'openstack-neutron-vpnaas',
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'a neutron server'
|
||||
it_behaves_like 'a neutron server without database synchronization'
|
||||
it_behaves_like "neutron server dynamic routing on #{facts[:os]['family']}"
|
||||
it_behaves_like 'neutron::server'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user