Merge "Remove Neutron FWaaS"

This commit is contained in:
Zuul 2021-09-14 18:17:40 +00:00 committed by Gerrit Code Review
commit 61febdcd83
12 changed files with 9 additions and 453 deletions

View File

@ -1,16 +0,0 @@
# DEPRECATED!
Puppet::Type.type(:neutron_fwaas_service_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/fwaas_driver.ini'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end

View File

@ -1,29 +0,0 @@
# DEPRECATED!
Puppet::Type.newtype(:neutron_fwaas_service_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from fwaas_driver.ini'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:anchor) do
['neutron::install::end']
end
end

View File

@ -43,7 +43,6 @@ class neutron::deps {
Anchor['neutron::config::begin'] -> Neutron_sfc_service_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_dhcp_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_fwaas_service_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_l2gw_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_l3_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_metadata_agent_config<||> ~> Anchor['neutron::config::end']

View File

@ -70,7 +70,6 @@ class neutron::params {
$libreswan_package = 'libreswan'
$metadata_agent_package = false
$l3_agent_package = false
$fwaas_package = 'openstack-neutron-fwaas'
$neutron_wsgi_script_path = '/var/www/cgi-bin/neutron'
$neutron_wsgi_script_source = '/usr/bin/neutron-api'
$networking_baremetal_package = 'python3-networking-baremetal'
@ -118,7 +117,6 @@ class neutron::params {
$libreswan_package = false
$metadata_agent_package = 'neutron-metadata-agent'
$l3_agent_package = 'neutron-l3-agent'
$fwaas_package = 'python3-neutron-fwaas'
$l2gw_agent_package = 'neutron-l2gateway-agent'
$l2gw_package = 'python3-networking-l2gw'
$neutron_wsgi_script_path = '/usr/lib/cgi-bin/neutron'

View File

@ -225,13 +225,6 @@
# mechanism driver for Neutron.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*ensure_fwaas_package*]
# (Optional) Ensures installation of FWaaS package before starting API service.
# Set to true to ensure installation of the package that is required to start neutron service if service_plugin is enabled.
# Defaults to undef.
#
class neutron::server (
$package_ensure = 'present',
$enabled = true,
@ -270,8 +263,6 @@ class neutron::server (
$max_request_body_size = $::os_service_default,
$ovs_integration_bridge = $::os_service_default,
$igmp_snooping_enable = $::os_service_default,
# DEPRECATED PARAMETERS
$ensure_fwaas_package = undef,
) inherits neutron::params {
include neutron::deps
@ -291,34 +282,6 @@ class neutron::server (
validate_legacy(Array, 'validate_array', $service_providers)
}
if $ensure_fwaas_package {
warning('neutron::server::ensure_fwaas_package is deprecated and will be removed in a future release')
if ($::osfamily == 'Debian') {
# Debian platforms
if $vpnaas_agent_package {
ensure_resource( 'package', $::neutron::params::vpnaas_agent_package, {
'ensure' => $neutron::package_ensure,
'tag' => ['openstack', 'neutron-package'],
})
Package[$::neutron::params::vpnaas_agent_package] -> Neutron_fwaas_service_config<||>
} else {
ensure_resource( 'package', 'neutron-fwaas' , {
'name' => $::neutron::params::fwaas_package,
'ensure' => $neutron::package_ensure,
'tag' => ['openstack', 'neutron-package'],
})
}
} elsif($::osfamily == 'Redhat') {
# RH platforms
ensure_resource( 'package', 'neutron-fwaas', {
'name' => $::neutron::params::fwaas_package,
'ensure' => $neutron::package_ensure,
'tag' => ['openstack', 'neutron-package'],
})
}
}
if $ensure_vpnaas_package {
ensure_resource( 'package', 'neutron-vpnaas-agent', {
'ensure' => $package_ensure,

View File

@ -1,104 +0,0 @@
#
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Emilien Macchi <emilien.macchi@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#
# DEPRECATED!!!
#
# == Class: neutron::services::fwaas
#
# Configure the Firewall as a Service Neutron Plugin
#
# === Parameters:
#
# [*enabled*]
# (optional) Whether or not to enable the FWaaS neutron plugin Service
# Defaults to $::os_service_default
#
# [*driver*]
# (optional) FWaaS Driver to use
# Defaults to $::os_service_default
#
# [*agent_version*]
# (optional) Version of FWaaS API.
# Defaults to $::os_service_default
#
# [*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
# true/false
# Defaults to false
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the fwaas config.
# Defaults to false.
#
class neutron::services::fwaas (
$enabled = $::os_service_default,
$driver = $::os_service_default,
$agent_version = $::os_service_default,
$vpnaas_agent_package = false,
$purge_config = false,
) {
include neutron::deps
include neutron::params
warning('neutron::services:fwaas is deprecated and will be removed in a future release.')
if ($::osfamily == 'Debian') {
# Debian platforms
if $vpnaas_agent_package {
ensure_resource( 'package', 'neutron-vpn-agent', {
'name' => $::neutron::params::vpnaas_agent_package,
'ensure' => $neutron::package_ensure,
'tag' => ['openstack', 'neutron-package'],
})
}
else {
ensure_resource( 'package', 'neutron-fwaas' , {
'name' => $::neutron::params::fwaas_package,
'ensure' => $neutron::package_ensure,
'tag' => ['openstack', 'neutron-package'],
})
}
} elsif($::osfamily == 'Redhat') {
# RH platforms
ensure_resource( 'package', 'neutron-fwaas', {
'name' => $::neutron::params::fwaas_package,
'ensure' => $neutron::package_ensure,
'tag' => ['openstack', 'neutron-package'],
})
}
resources { 'neutron_fwaas_service_config':
purge => $purge_config,
}
neutron_config {
'fwaas/enabled': value => $enabled;
'fwaas/driver': value => $driver;
'fwaas/agent_version': value => $agent_version;
}
neutron_fwaas_service_config {
'fwaas/enabled': value => $enabled;
'fwaas/driver': value => $driver;
'fwaas/agent_version': value => $agent_version;
}
}

View File

@ -0,0 +1,8 @@
---
upgrades:
- |
The ``neutron::server::ensure_fwaas_package`` parameter has been removed
- |
The ``neutron::services::fwaas`` class has been removed.
- |
The ``neutron_fwaas_service_config`` resource has been removed.

View File

@ -5,7 +5,6 @@ describe 'basic neutron_config resource' do
neutron_files = [ '/etc/neutron/api-paste.ini',
'/etc/neutron/neutron.conf',
'/etc/neutron/dhcp_agent.ini',
'/etc/neutron/fwaas_driver.ini',
'/etc/neutron/l3_agent.ini',
'/etc/neutron/metadata_agent.ini',
'/etc/neutron/metering_agent.ini',
@ -27,7 +26,6 @@ describe 'basic neutron_config resource' do
File <||> -> Neutron_config <||>
File <||> -> Neutron_api_paste_ini <||>
File <||> -> Neutron_dhcp_agent_config <||>
File <||> -> Neutron_fwaas_service_config <||>
File <||> -> Neutron_l3_agent_config <||>
File <||> -> Neutron_metadata_agent_config <||>
File <||> -> Neutron_metering_agent_config <||>
@ -57,7 +55,6 @@ describe 'basic neutron_config resource' do
$neutron_files = [ '/etc/neutron/api-paste.ini',
'/etc/neutron/neutron.conf',
'/etc/neutron/dhcp_agent.ini',
'/etc/neutron/fwaas_driver.ini',
'/etc/neutron/l3_agent.ini',
'/etc/neutron/metadata_agent.ini',
'/etc/neutron/metering_agent.ini',
@ -134,24 +131,6 @@ describe 'basic neutron_config resource' do
ensure_absent_val => 'toto',
}
neutron_fwaas_service_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
neutron_fwaas_service_config { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
neutron_fwaas_service_config { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
neutron_fwaas_service_config { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
neutron_l3_agent_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
@ -445,7 +424,6 @@ describe 'basic neutron_config resource' do
resource_names = ['neutron_api_paste_ini',
'neutron_config',
'neutron_dhcp_agent_config',
'neutron_fwaas_service_config',
'neutron_l3_agent_config',
'neutron_metadata_agent_config',
'neutron_plugin_linuxbridge',

View File

@ -274,16 +274,14 @@ describe 'neutron::server' do
end
shared_examples 'VPNaaS and FWaaS package installation' do
shared_examples 'VPNaaS package installation' do
before do
params.merge!(
:ensure_vpnaas_package => true,
:ensure_fwaas_package => true,
)
end
it 'should install *aaS packages' do
should contain_package('neutron-fwaas')
should contain_package('neutron-vpnaas-agent')
end
end

View File

@ -1,145 +0,0 @@
#
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Emilien Macchi <emilien.macchi@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Unit tests for neutron::services::fwaas class
#
require 'spec_helper'
describe 'neutron::services::fwaas' do
let :pre_condition do
"class { 'neutron': }
include neutron::agents::l3"
end
let :params do
{}
end
let :default_params do
{
:vpnaas_agent_package => false,
:purge_config => false,
}
end
shared_examples 'neutron fwaas service plugin' do
let :params_hash do
default_params.merge(params)
end
it 'passes purge to resource' do
should contain_resources('neutron_fwaas_service_config').with({
:purge => false
})
end
it 'configures driver in fwaas_driver.ini' do
should contain_neutron_fwaas_service_config('fwaas/driver').with_value('<SERVICE DEFAULT>')
should contain_neutron_fwaas_service_config('fwaas/enabled').with_value('<SERVICE DEFAULT>')
should contain_neutron_fwaas_service_config('fwaas/agent_version').with_value('<SERVICE DEFAULT>')
end
it 'configures driver in neutron.conf' do
should contain_neutron_config('fwaas/driver').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('fwaas/enabled').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('fwaas/agent_version').with_value('<SERVICE DEFAULT>')
end
end
shared_examples 'neutron::services::fwaas on Ubuntu' do
it 'installs neutron fwaas package' do
should contain_package('neutron-fwaas').with(
:ensure => 'present',
:tag => ['openstack', 'neutron-package'],
:name => platform_params[:fwaas_package_name],
)
end
end
shared_examples 'neutron::services::fwaas on Debian' do
context 'without VPNaaS package' do
it 'installs neutron fwaas package' do
should contain_package('neutron-fwaas').with(
:ensure => 'present',
:tag => ['openstack', 'neutron-package'],
:name => platform_params[:fwaas_package_name],
)
end
end
context 'with VPNaaS package' do
before do
params.merge!( :vpnaas_agent_package => true )
end
it 'installs neutron vpnaas agent package' do
should contain_package('neutron-vpn-agent').with(
:ensure => 'present',
:name => platform_params[:vpnaas_package_name],
:tag => ['openstack', 'neutron-package'],
)
end
end
end
shared_examples 'neutron::services::fwaas on RedHat' do
it 'installs neutron fwaas service package' do
should contain_package('neutron-fwaas').with(
:ensure => 'present',
:name => platform_params[:fwaas_package_name],
)
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{
:fwaas_package_name => 'python3-neutron-fwaas',
:vpnaas_package_name => 'python3-neutron-vpnaas'
}
when 'RedHat'
{
:fwaas_package_name => 'openstack-neutron-fwaas'
}
end
end
it_behaves_like 'neutron fwaas service plugin'
case facts[:operatingsystem]
when 'Debian'
it_behaves_like 'neutron::services::fwaas on Debian'
when 'Ubuntu'
it_behaves_like 'neutron::services::fwaas on Ubuntu'
end
if facts[:osfamily] == 'RedHat'
it_behaves_like 'neutron::services::fwaas on RedHat'
end
end
end
end

View File

@ -1,74 +0,0 @@
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'openstacklib',
'lib')
)
require 'spec_helper'
provider_class = Puppet::Type.type(:neutron_fwaas_service_config).provider(:ini_setting)
describe provider_class do
it 'should default to the default setting when no other one is specified' do
resource = Puppet::Type::Neutron_fwaas_service_config.new(
{
:name => 'DEFAULT/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/fwaas_driver.ini')
end
it 'should allow setting to be set explicitly' do
resource = Puppet::Type::Neutron_fwaas_service_config.new(
{
:name => 'dude/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/fwaas_driver.ini')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Neutron_fwaas_service_config.new(
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Neutron_fwaas_service_config.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end

View File

@ -1,20 +0,0 @@
require 'puppet'
require 'puppet/type/neutron_fwaas_service_config'
describe 'Puppet::Type.type(:neutron_fwaas_service_config)' do
before :each do
@neutron_fwaas_service_config = Puppet::Type.type(:neutron_fwaas_service_config).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should autorequire the package that install the file' do
catalog = Puppet::Resource::Catalog.new
anchor = Puppet::Type.type(:anchor).new(:name => 'neutron::install::end')
catalog.add_resource anchor, @neutron_fwaas_service_config
dependency = @neutron_fwaas_service_config.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@neutron_fwaas_service_config)
expect(dependency[0].source).to eq(anchor)
end
end