Update VPNaaS setup to match migration to agent

neutron-vpnaas has moved to a VPNaaS agent [1] without an agent
service. Updating puppet-neutron to match it.

[1] - https://review.openstack.org/488247

Change-Id: Ida3f5a1e3fd6edd6f0cb829d8469b10795dc85f0
This commit is contained in:
Javier Pena 2017-11-02 10:32:33 +01:00
parent 0a2b0141a8
commit 2d5af891ec
4 changed files with 28 additions and 56 deletions

View File

@ -24,13 +24,6 @@
# [*package_ensure*]
# (optional) Ensure state for package. Defaults to 'present'.
#
# [*enabled*]
# (optional) Enable state for service. Defaults to 'true'.
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*vpn_device_driver*]
# (optional) Defaults to 'neutron.services.vpn.device_drivers.ipsec.OpenSwanDriver'.
#
@ -45,19 +38,35 @@
# in the vpnaas config.
# Defaults to false.
#
# DEPRECATED PARAMETERS
# [*enabled*]
# (optional) Enable state for service. Defaults to undef.
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to undef
class neutron::agents::vpnaas (
$package_ensure = present,
$enabled = true,
$manage_service = true,
$vpn_device_driver = 'neutron.services.vpn.device_drivers.ipsec.OpenSwanDriver',
$interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
$ipsec_status_check_interval = $::os_service_default,
$purge_config = false,
# DEPRECATED PARAMETERS
$enabled = undef,
$manage_service = undef,
) {
include ::neutron::deps
include ::neutron::params
if $enabled{
warning ('enabled is deprecated, has no effect and will be removed in a future release.')
}
if $manage_service{
warning ('manage_service is deprecated, has no effect and will be removed in a future release.')
}
case $vpn_device_driver {
/\.OpenSwan/: {
Package['openswan'] -> Package<| title == 'neutron-vpnaas-agent' |>
@ -104,19 +113,4 @@ class neutron::agents::vpnaas (
'tag' => ['openstack', 'neutron-package'],
})
}
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
}
service { 'neutron-vpnaas-service':
ensure => $service_ensure,
name => $::neutron::params::vpnaas_agent_service,
enable => $enabled,
tag => 'neutron-service',
}
}

View File

@ -26,7 +26,6 @@ class neutron::params {
$lbaasv2_agent_service = 'neutron-lbaasv2-agent'
$haproxy_package = 'haproxy'
$metering_agent_service = 'neutron-metering-agent'
$vpnaas_agent_service = 'neutron-vpn-agent'
$l3_agent_service = 'neutron-l3-agent'
$metadata_agent_service = 'neutron-metadata-agent'
$bagpipe_bgp_package = 'openstack-bagpipe-bgp'

View File

@ -0,0 +1,7 @@
---
deprecations:
- |
The neutron-vpnaas project has removed the agent service in
https://review.openstack.org/517263 . Thus, the "enabled" and
"manage_service" parameters of class neutron::agents:vpnaas have been
deprecated in Queens.

View File

@ -32,7 +32,6 @@ describe 'neutron::agents::vpnaas' do
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:vpn_device_driver => 'neutron.services.vpn.device_drivers.ipsec.OpenSwanDriver',
:interface_driver => 'neutron.agent.linux.interface.OVSInterfaceDriver',
:purge_config => false,
@ -77,26 +76,6 @@ describe 'neutron::agents::vpnaas' do
is_expected.to contain_package('neutron').that_notifies('Anchor[neutron::install::end]')
end
end
it 'configures neutron vpnaas agent service' do
is_expected.to contain_service('neutron-vpnaas-service').with(
:name => platform_params[:vpnaas_agent_service],
:enable => true,
:ensure => 'running',
:tag => 'neutron-service',
)
is_expected.to contain_service('neutron-vpnaas-service').that_subscribes_to('Anchor[neutron::service::begin]')
is_expected.to contain_service('neutron-vpnaas-service').that_notifies('Anchor[neutron::service::end]')
end
context 'with manage_service as false' do
before :each do
params.merge!(:manage_service => false)
end
it 'should not start/stop service' do
is_expected.to contain_service('neutron-vpnaas-service').without_ensure
end
end
end
shared_examples_for 'openswan vpnaas_driver' do
@ -120,15 +99,10 @@ describe 'neutron::agents::vpnaas' do
let :platform_params do
{ :openswan_package => 'openswan',
:vpnaas_agent_package => 'neutron-vpn-agent',
:vpnaas_agent_service => 'neutron-vpn-agent' }
:vpnaas_agent_package => 'neutron-vpn-agent'}
end
it_configures 'neutron vpnaas agent'
it 'configures subscription to neutron-vpnaas-agent package' do
is_expected.to contain_service('neutron-vpnaas-service').that_subscribes_to('Anchor[neutron::service::begin]')
is_expected.to contain_service('neutron-vpnaas-service').that_notifies('Anchor[neutron::service::end]')
end
context 'when configuring the LibreSwan driver' do
before do
@ -153,8 +127,7 @@ describe 'neutron::agents::vpnaas' do
let :platform_params do
{ :openswan_package => 'openswan',
:vpnaas_agent_package => 'openstack-neutron-vpnaas',
:vpnaas_agent_service => 'neutron-vpn-agent'}
:vpnaas_agent_package => 'openstack-neutron-vpnaas'}
end
it_configures 'neutron vpnaas agent'
@ -171,8 +144,7 @@ describe 'neutron::agents::vpnaas' do
let :platform_params do
{ :openswan_package => 'libreswan',
:libreswan_package => 'libreswan',
:vpnaas_agent_package => 'openstack-neutron-vpnaas',
:vpnaas_agent_service => 'neutron-vpn-agent'}
:vpnaas_agent_package => 'openstack-neutron-vpnaas'}
end
it_configures 'neutron vpnaas agent'