Remove LBaas

This removes the old LBaaS and LBaaS v2 integrations
that will be removed upstream in the Neutron release.

Depends-On: https://review.opendev.org/#/c/658803/
Change-Id: I9282e07043107a62769cb57d94b87ee8fb70cb38
This commit is contained in:
Tobias Urdin 2019-05-13 14:42:04 +02:00
parent dd3ba5ed0a
commit 4538cc008c
25 changed files with 24 additions and 1144 deletions

View File

@ -23,7 +23,6 @@ class { '::neutron::server::notifications':
# Various agents
class { '::neutron::agents::dhcp': }
class { '::neutron::agents::l3': }
class { '::neutron::agents::lbaas': }
class { '::neutron::agents::vpnaas': }
class { '::neutron::agents::metering': }

View File

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

View File

@ -1,15 +0,0 @@
Puppet::Type.type(:neutron_lbaas_service_config).provide(
:openstackconfig,
:parent => Puppet::Type.type(:openstack_config).provider(:ruby)
) do
def self.file_path
'/etc/neutron/neutron.conf'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end

View File

@ -1,28 +0,0 @@
Puppet::Type.newtype(:neutron_lbaas_agent_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from lbaas_agent.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(:package) do
'neutron-lbaas-agent'
end
end

View File

@ -1,40 +0,0 @@
Puppet::Type.newtype(:neutron_lbaas_service_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from neutron.conf'
newvalues(/\S+\/\S+/)
end
newproperty(:value, :array_matching => :all) do
desc 'The value of the setting to be defined.'
def insync?(is)
return true if @should.empty?
return false unless is.is_a? Array
return false unless is.length == @should.length
# we don't care about the order of items in array, hence
# it is necessary to override insync
return (
is & @should == is or
is & @should.map(&:to_s) == is
)
end
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(:package) do
'neutron-server'
end
end

View File

@ -1,109 +0,0 @@
# == Class: neutron::agents:lbaas:
#
# Setups Neutron Load Balancing agent.
#
# === Parameters
#
# [*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
#
# [*debug*]
# (optional) Show debugging output in log. Defaults to $::os_service_default.
#
# [*interface_driver*]
# (optional) Defaults to 'neutron.agent.linux.interface.OVSInterfaceDriver'.
#
# [*device_driver*]
# (optional) Defaults to 'neutron_lbaas.drivers.haproxy.namespace_driver.HaproxyNSDriver'.
#
# [*user_group*]
# (optional) The user group.
# Defaults to $::neutron::params::nobody_user_group
#
# [*manage_haproxy_package*]
# (optional) Whether to manage the haproxy package.
# Disable this if you are using the puppetlabs-haproxy module
# Defaults to true
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the lbaas config.
# Defaults to false.
#
# [*ovs_use_veth*]
# (optional) Uses veth for an interface or not.
# Defaults to $::os_service_default.
#
class neutron::agents::lbaas (
$package_ensure = present,
$enabled = true,
$manage_service = true,
$debug = $::os_service_default,
$interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
$device_driver = 'neutron_lbaas.drivers.haproxy.namespace_driver.HaproxyNSDriver',
$ovs_use_veth = $::os_service_default,
$user_group = $::neutron::params::nobody_user_group,
$manage_haproxy_package = true,
$purge_config = false,
) {
include ::neutron::deps
include ::neutron::params
warning('neutron::agents::lbaas is deprecated and will be removed in a future release')
case $device_driver {
/\.haproxy/: {
Package <| title == $::neutron::params::haproxy_package |> -> Package <| title == 'neutron-lbaasv2-agent' |>
if $manage_haproxy_package {
ensure_packages([$::neutron::params::haproxy_package])
}
}
$::os_service_default: {}
default: {
fail("Unsupported device_driver ${device_driver}")
}
}
resources { 'neutron_lbaas_agent_config':
purge => $purge_config,
}
# The LBaaS agent loads both neutron.conf and its own file.
# This only lists config specific to the agent. neutron.conf supplies
# the rest.
neutron_lbaas_agent_config {
'DEFAULT/debug': value => $debug;
'DEFAULT/interface_driver': value => $interface_driver;
'DEFAULT/device_driver': value => $device_driver;
'DEFAULT/ovs_use_veth': value => $ovs_use_veth;
'haproxy/user_group': value => $user_group;
}
Package['neutron'] -> Package['neutron-lbaasv2-agent']
ensure_resource( 'package', 'neutron-lbaasv2-agent', {
ensure => $package_ensure,
name => $::neutron::params::lbaasv2_agent_package,
tag => ['openstack', 'neutron-package'],
})
if $manage_service {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
service { 'neutron-lbaasv2-service':
ensure => $service_ensure,
name => $::neutron::params::lbaasv2_agent_service,
enable => $enabled,
tag => 'neutron-service',
}
}

View File

@ -99,11 +99,6 @@
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
#### DEPRECATED
#
# [*lbaas_agent_config*]
# (optional) Manage configuration of lbaas_agent.ini
#
class neutron::config (
$server_config = {},
$api_config = {},
@ -130,8 +125,6 @@ class neutron::config (
$plugin_ml2_config = {},
$plugin_nsx_config = {},
$plugin_nvp_config = {},
### DEPRECATED PARAMS
$lbaas_agent_config = undef,
) {
include ::neutron::deps
@ -162,13 +155,6 @@ class neutron::config (
validate_legacy(Hash, 'validate_hash', $plugin_nsx_config)
validate_legacy(Hash, 'validate_hash', $plugin_nvp_config)
if $lbaas_agent_config {
validate_legacy(Hash, 'validate_hash', $lbaas_agent_config)
warning('neutron::config::lbaas_agent_config is deprecated and will be removed in a future release')
create_resources('neutron_lbaas_agent_config', $lbaas_agent_config)
}
create_resources('neutron_config', $server_config)
create_resources('neutron_api_config', $api_config)
create_resources('neutron_bgpvpn_bagpipe_config', $bgpvpn_bagpipe_config)

View File

@ -46,8 +46,6 @@ class neutron::deps {
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_lbaas_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_lbaas_service_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_metadata_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_metering_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_bgp_dragent_config<||> ~> Anchor['neutron::config::end']

View File

@ -36,7 +36,7 @@
# [*service_plugins*]
# (optional) Advanced service modules.
# Could be an array that can have these elements:
# router, firewall, lbaas, vpnaas, metering, qos
# router, firewall, vpnaas, metering, qos
# Defaults to $::os_service_default
#
# [*auth_strategy*]

View File

@ -24,7 +24,6 @@ class neutron::params {
$plumgrid_config_file = '/etc/neutron/plugins/plumgrid/plumgrid.ini'
$nuage_config_file = '/etc/neutron/plugins/nuage/plugin.ini'
$dhcp_agent_service = 'neutron-dhcp-agent'
$lbaasv2_agent_service = 'neutron-lbaasv2-agent'
$haproxy_package = 'haproxy'
$metering_agent_service = 'neutron-metering-agent'
$l3_agent_service = 'neutron-l3-agent'
@ -67,7 +66,6 @@ class neutron::params {
$cisco_server_package = 'openstack-neutron-cisco'
$nvp_server_package = 'openstack-neutron-nicira'
$dhcp_agent_package = false
$lbaasv2_agent_package = 'openstack-neutron-lbaas'
$metering_agent_package = 'openstack-neutron-metering-agent'
$vpnaas_agent_package = 'openstack-neutron-vpnaas'
$l2gw_agent_package = 'openstack-neutron-l2gw-agent'
@ -83,7 +81,6 @@ class neutron::params {
$libreswan_package = 'libreswan'
$metadata_agent_package = false
$l3_agent_package = false
$lbaas_package = false
$fwaas_package = 'openstack-neutron-fwaas'
$neutron_wsgi_script_path = '/var/www/cgi-bin/neutron'
$neutron_wsgi_script_source = '/usr/bin/neutron-api'
@ -103,7 +100,6 @@ class neutron::params {
$rpc_package_name = 'neutron-rpc-server'
$rpc_service_name = 'neutron-rpc-server'
$dynamic_routing_package = 'python3-neutron-dynamic-routing'
$lbaas_package = 'python3-neutron-lbaas'
} else {
$ml2_server_package = 'neutron-plugin-ml2'
$server_service = 'neutron-server'
@ -113,7 +109,6 @@ class neutron::params {
$rpc_package_name = false
$rpc_service_name = false
$dynamic_routing_package = "python${pyvers}-neutron-dynamic-routing"
$lbaas_package = "python${pyvers}-neutron-lbaas"
}
$bgp_dragent_package = 'neutron-bgp-dragent'
$ovs_agent_package = 'neutron-openvswitch-agent'
@ -128,7 +123,6 @@ class neutron::params {
$cisco_server_package = 'neutron-plugin-cisco'
$nvp_server_package = 'neutron-plugin-nicira'
$dhcp_agent_package = 'neutron-dhcp-agent'
$lbaasv2_agent_package = 'neutron-lbaasv2-agent'
$metering_agent_package = 'neutron-metering-agent'
$vpnaas_agent_package = 'python-neutron-vpnaas'
$openswan_package = 'strongswan'

View File

@ -219,15 +219,13 @@
#
# [*service_providers*]
# (Optional) (Array) Configures the service providers for neutron server.
# This needs to be set for lbaas, vpnaas, and fwaas.
# This needs to be set for vpnaas, fwaas etc.
# Defaults to $::os_service_default
#
# Example:
#
# class { 'neutron::server':
# service_providers => [
# 'LOADBALANCERV2:Octavia:neutron_lbaas.drivers.octavia.driver.OctaviaDriver:default',
# 'LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver',
# 'VPN:openswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default'
# ]
# }
@ -245,13 +243,6 @@
# (Optional) Name of Open vSwitch bridge to use
# Defaults to $::os_service_default
#
### DEPRECATED PARAMS
#
# [*ensure_lbaas_package*]
# (Optional) Ensures installation of LBaaS package before starting API service.
# Set to true to ensure installation of the package that is required to start neutron service if lbaasv2 service_plugin is enabled.
# Defaults to false.
#
class neutron::server (
$package_ensure = 'present',
$enabled = true,
@ -296,8 +287,6 @@ class neutron::server (
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default,
$ovs_integration_bridge = $::os_service_default,
### DEPRECATED PARAMS
$ensure_lbaas_package = false,
) inherits ::neutron::params {
include ::neutron::deps
@ -345,27 +334,6 @@ class neutron::server (
}
}
if $ensure_lbaas_package {
warning('neutron::server::ensure_lbaas_package is deprecated and will be removed in a future release')
if $::neutron::params::lbaas_package {
ensure_packages('neutron-lbaas', {
ensure => $package_ensure,
name => $::neutron::params::lbaas_package,
tag => ['openstack', 'neutron-package']
})
} elsif $::neutron::params::lbaasv2_agent_package {
# RedHat package ships LBaaS and agent in same package
# so we install it here, it's fine because RedHat doesn't
# start services by default.
ensure_packages('neutron-lbaasv2-agent', {
ensure => $package_ensure,
name => $::neutron::params::lbaasv2_agent_package,
tag => ['openstack', 'neutron-package'],
})
}
}
if $ensure_vpnaas_package {
ensure_resource( 'package', 'neutron-vpnaas-agent', {
'ensure' => $package_ensure,

View File

@ -1,71 +0,0 @@
#
# Copyright (C) 2015 Red Hat Inc.
#
# Author: Martin Magr <mmagr@redhat.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
# This class has been deprecated in favor of using the parameter in
# neutron::server::service_provider
#
# == Class: neutron::services::lbaas
#
# Configure the Loadbalancer as a Service Neutron Plugin
#
# === Parameters:
#
# [*ensure_lbaas_driver_package*]
# (optional) Whether to install the lbaas driver package
# Defaults to 'present'
#
# [*cert_manager_type*]
# (optional) Certificate manager type to use for lbaas.
# Defaults to $::os_service_default
# Example: barbican
#
# [*cert_storage_path*]
# (optional) The location to store certificates locally.
# Defaults to $::os_service_default
# Example: /var/lib/neutron-lbaas/certificates/
#
# [*barbican_auth*]
# (optional) Name of the barbican authentication method to use.
# Defaults to $::os_service_default
# Example: barbican_acl_auth
#
class neutron::services::lbaas (
$cert_manager_type = $::os_service_default,
$cert_storage_path = $::os_service_default,
$barbican_auth = $::os_service_default,
$ensure_lbaas_driver_package = 'present',
) {
warning('neutron::services::lbaas class is deprecated and will be removed in a future release.')
include ::neutron::deps
include ::neutron::params
if $ensure_lbaas_driver_package {
ensure_packages(["python${neutron::params::pyvers}-neutron-lbaas"], {
ensure => $ensure_lbaas_driver_package,
tag => ['openstack', 'neutron-package']
})
}
neutron_config {
'certificates/cert_manager_type': value => $cert_manager_type;
'certificates/storage_path': value => $cert_storage_path;
'certificates/barbican_auth': value => $barbican_auth;
}
}

View File

@ -1,72 +0,0 @@
#
# Copyright (C) 2016 Matthew J. Black
#
# Author: Matthew J. Black <mjblack@gmail.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.
#
# == Class: neutron::services::lbaas::haproxy
#
# Configure the haproxy LBaaS service provider
#
# === Parameters:
#
# [*interface_driver*]
# (optional) The driver to manage the virtual interface
# Defaults to $::os_service_default
#
# [*periodic_interval*]
# (optional) Seconds between periodic task runs
# Defaults to $::os_service_default
#
# [*loadbalancer_state_path*]
# (optional) Location to store config and state files
# Defaults to $::os_service_default
#
# [*user_group*]
# (optional) The user/group to run haproxy.
# Defaults to $::os_service_default
#
# [*send_gratuitous_arp*]
# (optional) Send gratuitous arps to flush the arp cache
# when VIP is deleted and re-added.
# Defaults to $::os_service_default
#
# [*jinja_config_template*]
# (optional) The template location to be used for haproxy.
# Defaults to $::os_service_default
#
#
class neutron::services::lbaas::haproxy(
$interface_driver = $::os_service_default,
$periodic_interval = $::os_service_default,
$loadbalancer_state_path = $::os_service_default,
$user_group = $::os_service_default,
$send_gratuitous_arp = $::os_service_default,
$jinja_config_template = $::os_service_default
) {
include ::neutron::deps
warning('neutron::services::lbaas::haproxy is deprecated and will be removed in a future release')
neutron_config {
'haproxy/interface_driver': value => $interface_driver;
'haproxy/periodic_interval': value => $periodic_interval;
'haproxy/loadbalancer_state_path': value => $loadbalancer_state_path;
'haproxy/user_group': value => $user_group;
'haproxy/send_gratuitous_arp': value => $send_gratuitous_arp;
'haproxy/jinja_config_template': value => $jinja_config_template;
}
}

View File

@ -1,117 +0,0 @@
#
# Copyright (C) 2016 Matthew J. Black
#
# Author: Matthew J. Black <mjblack@gmail.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.
#
# == Class: neutron::services::lbaas::octavia
#
# Configure the Octavia LBaaS service provider
#
# === Parameters:
#
# [*base_url*]
# (optional) The url endpoint for Octavia.
# Defaults to 'https://127.0.0.1:9876'
#
# [*request_poll_interval*]
# (optional) Interval in sections to poll octavia when
# entity is created, updated, or deleted
# Defaults to $::os_service_default
#
# [*request_poll_timeout*]
# (optional) Time to stop polling octavia when status
# of an entity does not change.
# Defaults to $::os_service_default
#
# [*allocates_vip*]
# (optional) Whether Octavia is responsible for allocating
# the VIP.
#
# [*auth_url*]
# (optional) Keystone Authentication URL
# Defaults to $::os_service_default Defaults to $::os_service_default
#
# [*admin_user*]
# (optional) User for LBaaS authentication
# Defaults to $::os_service_default
#
# [*admin_tenant_name*]
# (optional) Tenant for LBaaS authentication
# Defaults to 'services'
#
# [*admin_password*]
# (optional) Password for LBaaS authentication
# Defaults to $::os_service_default
#
# [*admin_user_domain*]
# (optional) User domain for LBaaS authentication
# Defaults to $::os_service_default
#
# [*admin_project_domain*]
# (optional) Project domain for LBaaS authentication
# Defaults to $::os_service_default
#
# [*auth_version*]
# (optional) Authentication version
# Defaults to $::os_service_default
#
# [*endpoint_type*]
# (optional) Endpoint type (public/private/internal)
# Defaults to $::os_service_default
#
# [*insecure*]
# (optional) Accept insecure certificates
# Defaults to $::os_service_default
#
class neutron::services::lbaas::octavia(
$base_url = 'http://127.0.0.1:9876',
$request_poll_interval = $::os_service_default,
$request_poll_timeout = $::os_service_default,
$allocates_vip = $::os_service_default,
$auth_url = $::os_service_default,
$admin_user = $::os_service_default,
$admin_tenant_name = 'services',
$admin_password = $::os_service_default,
$admin_user_domain = $::os_service_default,
$admin_project_domain = $::os_service_default,
$auth_version = $::os_service_default,
$endpoint_type = $::os_service_default,
$insecure = $::os_service_default
) {
include ::neutron::deps
warning('neutron::services::lbaas::octavia is deprecated and will be removed in a future release')
neutron_config {
'octavia/base_url': value => $base_url;
'octavia/request_poll_interval': value => $request_poll_interval;
'octavia/request_poll_timeout': value => $request_poll_timeout;
'octavia/allocates_vip': value => $allocates_vip;
}
neutron_config {
'service_auth/auth_url' : value => $auth_url;
'service_auth/admin_user' : value => $admin_user;
'service_auth/admin_tenant_name' : value => $admin_tenant_name;
'service_auth/admin_password' : value => $admin_password;
'service_auth/admin_user_domain' : value => $admin_user_domain;
'service_auth/admin_project_domain' : value => $admin_project_domain;
'service_auth/auth_version' : value => $auth_version;
'service_auth/endpoint_type' : value => $endpoint_type;
'service_auth/insecure' : value => $insecure;
}
}

View File

@ -0,0 +1,20 @@
---
upgrade:
- |
The Neutron LBaaS plugin has been removed upstream and is no longer available
in the Train release. The following deprecated resources has been removed:
- ``neutron::agents::lbaas``
- ``neutron::config::lbaas_agent_config``
- ``neutron::server::ensure_lbaas_package``
- ``neutron::services::lbaas``
- ``neutron::services::lbaas::haproxy``
- ``neutron::services::lbaas::octavia``
- ``neutron_lbaas_agent_config``
- ``neutron_lbaas_service_config``
Please see the following link for more information on this deprecation:
https://wiki.openstack.org/wiki/Neutron/LBaaS/Deprecation
You should use the Octavia project to implement LBaaS.
https://docs.openstack.org/octavia/latest/reference/introduction.html

View File

@ -7,7 +7,6 @@ describe 'basic neutron_config resource' do
'/etc/neutron/dhcp_agent.ini',
'/etc/neutron/fwaas_driver.ini',
'/etc/neutron/l3_agent.ini',
'/etc/neutron/lbaas_agent.ini',
'/etc/neutron/metadata_agent.ini',
'/etc/neutron/metering_agent.ini',
'/etc/neutron/l2gw_plugin.ini',
@ -36,7 +35,6 @@ describe 'basic neutron_config resource' do
File <||> -> Neutron_dhcp_agent_config <||>
File <||> -> Neutron_fwaas_service_config <||>
File <||> -> Neutron_l3_agent_config <||>
File <||> -> Neutron_lbaas_agent_config <||>
File <||> -> Neutron_metadata_agent_config <||>
File <||> -> Neutron_metering_agent_config <||>
File <||> -> Neutron_plugin_cisco <||>
@ -77,7 +75,6 @@ describe 'basic neutron_config resource' do
'/etc/neutron/dhcp_agent.ini',
'/etc/neutron/fwaas_driver.ini',
'/etc/neutron/l3_agent.ini',
'/etc/neutron/lbaas_agent.ini',
'/etc/neutron/metadata_agent.ini',
'/etc/neutron/metering_agent.ini',
'/etc/neutron/l2gw_plugin.ini',
@ -195,24 +192,6 @@ describe 'basic neutron_config resource' do
ensure_absent_val => 'toto',
}
neutron_lbaas_agent_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
neutron_lbaas_agent_config { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
neutron_lbaas_agent_config { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
neutron_lbaas_agent_config { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
neutron_metadata_agent_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
@ -615,7 +594,6 @@ describe 'basic neutron_config resource' do
'neutron_dhcp_agent_config',
'neutron_fwaas_service_config',
'neutron_l3_agent_config',
'neutron_lbaas_agent_config',
'neutron_metadata_agent_config',
'neutron_plugin_cisco',
'neutron_plugin_cisco_credentials',

View File

@ -1,154 +0,0 @@
require 'spec_helper'
describe 'neutron::agents::lbaas' do
let :pre_condition do
"class { 'neutron': }"
end
let :params do
{}
end
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:interface_driver => 'neutron.agent.linux.interface.OVSInterfaceDriver',
:device_driver => 'neutron_lbaas.drivers.haproxy.namespace_driver.HaproxyNSDriver',
:manage_haproxy_package => true,
:purge_config => false
}
end
shared_examples 'neutron lbaas agent' do
let :p do
default_params.merge(params)
end
it { should contain_class('neutron::params') }
it_behaves_like 'haproxy lbaas_driver'
it_behaves_like 'haproxy lbaas_driver without package'
it 'passes purge to resource' do
should contain_resources('neutron_lbaas_agent_config').with({
:purge => false
})
end
it 'configures lbaas_agent.ini' do
should contain_neutron_lbaas_agent_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>');
should contain_neutron_lbaas_agent_config('DEFAULT/interface_driver').with_value(p[:interface_driver]);
should contain_neutron_lbaas_agent_config('DEFAULT/device_driver').with_value(p[:device_driver]);
should contain_neutron_lbaas_agent_config('haproxy/user_group').with_value(platform_params[:nobody_user_group]);
should contain_neutron_lbaas_agent_config('DEFAULT/ovs_use_veth').with_value('<SERVICE DEFAULT>');
end
it 'installs neutron lbaas agent package' do
should contain_package('neutron-lbaasv2-agent').with(
:name => platform_params[:lbaas_agent_package],
:ensure => p[:package_ensure],
:tag => ['openstack', 'neutron-package'],
)
should contain_package('neutron').with_before(/Package\[neutron-lbaasv2-agent\]/)
end
it 'configures neutron lbaas agent service' do
should contain_service('neutron-lbaasv2-service').with(
:name => platform_params[:lbaas_agent_service],
:enable => true,
:ensure => 'running',
:tag => 'neutron-service',
)
should contain_service('neutron-lbaasv2-service').that_subscribes_to('Anchor[neutron::service::begin]')
should contain_service('neutron-lbaasv2-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
should contain_service('neutron-lbaasv2-service').with(
:ensure => 'stopped',
)
end
end
context 'with ovs_use_veth as false' do
before :each do
params.merge!(:ovs_use_veth => false)
end
it 'should have ovs_use_veth set to false' do
should contain_neutron_lbaas_agent_config('DEFAULT/ovs_use_veth').with_value(false);
end
end
context 'with device_driver as $::os_service_default' do
before :each do
params.merge!(:device_driver => '<SERVICE DEFAULT>')
end
it 'should have devcie_driver set to $::os_service_default' do
should contain_neutron_lbaas_agent_config('DEFAULT/device_driver').with_value('<SERVICE DEFAULT>');
end
end
end
shared_examples 'haproxy lbaas_driver' do
it 'installs haproxy packages' do
if platform_params.has_key?(:lbaas_agent_package)
should contain_package(platform_params[:haproxy_package]).with_before(['Package[neutron-lbaasv2-agent]'])
end
should contain_package(platform_params[:haproxy_package]).with(
:ensure => 'present'
)
end
end
shared_examples 'haproxy lbaas_driver without package' do
let :pre_condition do
"package { 'haproxy':
ensure => 'present'
}
class { 'neutron': }"
end
before do
params.merge!(:manage_haproxy_package => false)
end
it 'installs haproxy package via haproxy module' do
should contain_package(platform_params[:haproxy_package]).with(
:ensure => 'present'
)
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( :concat_basedir => '/dne' ))
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{
:haproxy_package => 'haproxy',
:lbaas_agent_package => 'neutron-lbaasv2-agent',
:nobody_user_group => 'nogroup',
:lbaas_agent_service => 'neutron-lbaasv2-agent'
}
when 'RedHat'
{
:haproxy_package => 'haproxy',
:lbaas_agent_package => 'openstack-neutron-lbaas',
:nobody_user_group => 'nobody',
:lbaas_agent_service => 'neutron-lbaasv2-agent'
}
end
end
it_behaves_like 'neutron lbaas agent'
end
end
end

View File

@ -58,7 +58,6 @@ describe 'neutron::config' do
let :params do
{ :l3_agent_config => config_hash,
:dhcp_agent_config => config_hash,
:lbaas_agent_config => config_hash,
:metadata_agent_config => config_hash,
:metering_agent_config => config_hash,
:vpnaas_agent_config => config_hash,
@ -79,12 +78,6 @@ describe 'neutron::config' do
should contain_neutron_dhcp_agent_config('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary lbaas_agent_config configurations' do
should contain_neutron_lbaas_agent_config('DEFAULT/foo').with_value('fooValue')
should contain_neutron_lbaas_agent_config('DEFAULT/bar').with_value('barValue')
should contain_neutron_lbaas_agent_config('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary metadata_agent_config configurations' do
should contain_neutron_metadata_agent_config('DEFAULT/foo').with_value('fooValue')
should contain_neutron_metadata_agent_config('DEFAULT/bar').with_value('barValue')

View File

@ -320,12 +320,12 @@ describe 'neutron' do
shared_examples 'with service_plugins' do
before do
params.merge!(
:service_plugins => ['router','firewall','lbaas','vpnaas','metering','qos']
:service_plugins => ['router','firewall','vpnaas','metering','qos']
)
end
it do
should contain_neutron_config('DEFAULT/service_plugins').with_value('router,firewall,lbaas,vpnaas,metering,qos')
should contain_neutron_config('DEFAULT/service_plugins').with_value('router,firewall,vpnaas,metering,qos')
end
end

View File

@ -295,28 +295,6 @@ describe 'neutron::server' do
end
end
shared_examples 'neutron server lbaas on Debian' do
before do
params.merge!( :ensure_lbaas_package => true )
end
it 'should install lbaas package' do
should contain_package('neutron-lbaas')
should_not contain_package('neutron-lbaasv2-agent')
end
end
shared_examples 'neutron server lbaas on RedHat' do
before do
params.merge!( :ensure_lbaas_package => true )
end
it 'should install lbaasv2-agent package' do
should_not contain_package('neutron-lbaas')
should contain_package('neutron-lbaasv2-agent')
end
end
shared_examples 'a neutron server without database synchronization' do
before do
params.merge!(
@ -354,7 +332,6 @@ describe 'neutron::server' do
it_behaves_like 'a neutron server'
it_behaves_like 'a neutron server without database synchronization'
it_behaves_like "neutron server dynamic routing on #{facts[:osfamily]}"
it_behaves_like "neutron server lbaas on #{facts[:osfamily]}"
end
end
end

View File

@ -1,78 +0,0 @@
#
# Copyright (C) 2016 Matthew J. Black
#
# Author: Matthew J. Black <mjblack@gmail.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::lbaas::haproxy class
#
require 'spec_helper'
describe 'neutron::services::lbaas::haproxy' do
let :default_params do
{
:interface_driver => '<SERVICE DEFAULT>',
:periodic_interval => '<SERVICE DEFAULT>',
:loadbalancer_state_path => '<SERVICE DEFAULT>',
:user_group => '<SERVICE DEFAULT>',
:send_gratuitous_arp => '<SERVICE DEFAULT>',
:jinja_config_template => '<SERVICE DEFAULT>'}
end
shared_examples 'neutron::services::lbaas::haproxy' do
context 'with default params' do
let :params do
default_params
end
it 'configures haproxy service plugin' do
should contain_neutron_config('haproxy/interface_driver').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('haproxy/periodic_interval').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('haproxy/loadbalancer_state_path').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('haproxy/user_group').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('haproxy/send_gratuitous_arp').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('haproxy/jinja_config_template').with_value('<SERVICE DEFAULT>')
end
end
context 'when interface driver and gratuitous arp is set' do
let :params do
default_params.merge(
{
:interface_driver => 'neutron.agent.linux.interface.OVSInterfaceDriver',
:send_gratuitous_arp => true,
}
)
end
it 'configures haproxy service plugin custom parameters' do
should contain_neutron_config('haproxy/interface_driver').with_value('neutron.agent.linux.interface.OVSInterfaceDriver')
should contain_neutron_config('haproxy/send_gratuitous_arp').with_value(true)
end
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
it_behaves_like 'neutron::services::lbaas::haproxy'
end
end
end

View File

@ -1,152 +0,0 @@
#
# Copyright (C) 2016 Matthew J. Black
#
# Author: Matthew J. Black <mjblack@gmail.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::lbaas::octavia class
#
require 'spec_helper'
describe 'neutron::services::lbaas::octavia' do
let :default_params do
{
:base_url => 'http://127.0.0.1:9876',
:request_poll_interval => '<SERVICE DEFAULT>',
:request_poll_timeout => '<SERVICE DEFAULT>',
:allocates_vip => '<SERVICE DEFAULT>',
:auth_url => '<SERVICE DEFAULT>',
:admin_user => '<SERVICE DEFAULT>',
:admin_tenant_name => 'services',
:admin_password => '<SERVICE DEFAULT>',
:admin_user_domain => '<SERVICE DEFAULT>',
:admin_project_domain => '<SERVICE DEFAULT>',
:auth_version => '<SERVICE DEFAULT>',
:endpoint_type => '<SERVICE DEFAULT>',
:insecure => '<SERVICE DEFAULT>' }
end
shared_examples 'neutron::services::lbaas::octavia' do
context 'with default params' do
let :params do
default_params
end
it 'configures octavia service plugin' do
should contain_neutron_config('octavia/base_url').with_value('http://127.0.0.1:9876')
should contain_neutron_config('octavia/request_poll_interval').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('octavia/request_poll_timeout').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('octavia/allocates_vip').with_value('<SERVICE DEFAULT>')
end
it 'configures octavia service authentication' do
should contain_neutron_config('service_auth/auth_url').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/admin_user').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/admin_tenant_name').with_value('services')
should contain_neutron_config('service_auth/admin_password').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/admin_user_domain').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/admin_project_domain').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/auth_version').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/endpoint_type').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/insecure').with_value('<SERVICE DEFAULT>')
end
end
context 'when base_url is set' do
let :params do
default_params.merge(
{
:base_url => 'http://octavia.example.org:9876',
:request_poll_interval => '3',
:request_poll_timeout => '100',
:allocates_vip => 'false'
}
)
end
it 'configures octavia service plugin custom parameters' do
should contain_neutron_config('octavia/base_url').with_value('http://octavia.example.org:9876')
should contain_neutron_config('octavia/request_poll_interval').with_value('3')
should contain_neutron_config('octavia/request_poll_timeout').with_value('100')
should contain_neutron_config('octavia/allocates_vip').with_value('false')
end
it 'configures octavia service authentication' do
should contain_neutron_config('service_auth/auth_url').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/admin_user').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/admin_tenant_name').with_value('services')
should contain_neutron_config('service_auth/admin_password').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/admin_user_domain').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/admin_project_domain').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/auth_version').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/endpoint_type').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('service_auth/insecure').with_value('<SERVICE DEFAULT>')
end
end
context 'when base_url and service credentials are set' do
let :params do
default_params.merge(
{
:base_url => 'http://octavia.example.org:9876',
:request_poll_interval => '3',
:request_poll_timeout => '100',
:allocates_vip => 'false',
:auth_url => 'https://auth.openstack.cloud/v3',
:admin_user => 'admin',
:admin_tenant_name => 'service-tenant',
:admin_password => 'secure123',
:admin_user_domain => 'DefaultUsers',
:admin_project_domain => 'DefaultProjects',
:auth_version => '3',
:endpoint_type => 'public',
:insecure => 'false'
}
)
end
it 'configures octavia service plugin custom parameters' do
should contain_neutron_config('octavia/base_url').with_value('http://octavia.example.org:9876')
should contain_neutron_config('octavia/request_poll_interval').with_value('3')
should contain_neutron_config('octavia/request_poll_timeout').with_value('100')
should contain_neutron_config('octavia/allocates_vip').with_value('false')
end
it 'configures octavia service authentication' do
should contain_neutron_config('service_auth/auth_url').with_value('https://auth.openstack.cloud/v3')
should contain_neutron_config('service_auth/admin_user').with_value('admin')
should contain_neutron_config('service_auth/admin_tenant_name').with_value('service-tenant')
should contain_neutron_config('service_auth/admin_password').with_value('secure123')
should contain_neutron_config('service_auth/admin_user_domain').with_value('DefaultUsers')
should contain_neutron_config('service_auth/admin_project_domain').with_value('DefaultProjects')
should contain_neutron_config('service_auth/auth_version').with_value('3')
should contain_neutron_config('service_auth/endpoint_type').with_value('public')
should contain_neutron_config('service_auth/insecure').with_value('false')
end
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
it_behaves_like 'neutron::services::lbaas::octavia'
end
end
end

View File

@ -1,88 +0,0 @@
#
# Copyright (C) 2014 Red Hat Inc.
#
# Author: Martin Magr <mmagr@redhat.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::lbaas class
#
require 'spec_helper'
describe 'neutron::services::lbaas' do
let :default_params do
{}
end
shared_examples 'neutron lbaas service plugin' do
context 'with default params' do
let :params do
default_params
end
it 'should contain python-neutron-lbaas package' do
should contain_package(platform_params[:lbaas_package_name]).with({ :ensure => 'present' })
end
it 'should set certificates options with service defaults' do
should contain_neutron_config('certificates/cert_manager_type').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('certificates/storage_path').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('certificates/barbican_auth').with_value('<SERVICE DEFAULT>')
end
end
context 'with certificate manager options' do
before :each do
params.merge!(
{ :cert_manager_type => 'barbican',
:cert_storage_path => '/var/lib/neutron-lbaas/certificates/',
:barbican_auth => 'barbican_acl_auth'
}
)
it 'should configure certificates section' do
should contain_neutron_config('certificates/cert_manager_type').with_value('barbican')
should contain_neutron_config('certificates/storage_path').with_value('/var/lib/neutron-lbaas/certificates/')
should contain_neutron_config('certificates/barbican_auth').with_value('barbican_acl_auth')
end
end
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'
{
:lbaas_package_name => 'python3-neutron-lbaas'
}
when 'RedHat'
{
:lbaas_package_name => 'python-neutron-lbaas'
}
end
end
it_behaves_like 'neutron lbaas service plugin'
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_lbaas_agent_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_lbaas_agent_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/lbaas_agent.ini')
end
it 'should allow setting to be set explicitly' do
resource = Puppet::Type::Neutron_lbaas_agent_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/lbaas_agent.ini')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Neutron_lbaas_agent_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_lbaas_agent_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_lbaas_agent_config'
describe 'Puppet::Type.type(:neutron_lbaas_agent_config)' do
before :each do
@neutron_lbaas_agent_config = Puppet::Type.type(:neutron_lbaas_agent_config).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should autorequire the package that install the file' do
catalog = Puppet::Resource::Catalog.new
package = Puppet::Type.type(:package).new(:name => 'neutron-lbaas-agent')
catalog.add_resource package, @neutron_lbaas_agent_config
dependency = @neutron_lbaas_agent_config.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@neutron_lbaas_agent_config)
expect(dependency[0].source).to eq(package)
end
end