Remove support for plumgrid plugin

... which was deprecated in the previous cycle[1].

[1] 24a5a9aed9

Change-Id: I1f2f1a31ca0da0423f407d140aaaf95d9a9035b0
This commit is contained in:
Takashi Kajinami 2021-01-03 17:58:14 +09:00
parent 350450032c
commit f7c40f7056
17 changed files with 19 additions and 669 deletions

View File

@ -1,15 +0,0 @@
Puppet::Type.type(:neutron_plugin_plumgrid).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/plumgrid/plumgrid.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_plumlib_plumgrid).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/plumgrid/plumlib.ini'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end

View File

@ -1,56 +0,0 @@
Puppet::Type.newtype(:neutron_plugin_plumgrid) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from plumgrid.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
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
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(:file) do
['/etc/neutron/plugins/plumgrid']
end
autorequire(:anchor) do
['neutron::install::end']
end
end

View File

@ -1,56 +0,0 @@
Puppet::Type.newtype(:neutron_plumlib_plumgrid) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from plumlib.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
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
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(:file) do
['/etc/neutron/plugins/plumgrid']
end
autorequire(:anchor) do
['neutron::install::end']
end
end

View File

@ -78,9 +78,6 @@
# [*plugin_midonet_config*] # [*plugin_midonet_config*]
# (optional) Manage configuration of plugins/midonet/midonet.ini # (optional) Manage configuration of plugins/midonet/midonet.ini
# #
# [*plugin_plumgrid_config*]
# (optional) Manage configuration of plugins/plumgrid/plumgrid.ini
#
# [*plugin_opencontrail_config*] # [*plugin_opencontrail_config*]
# (optional) Manage configuration of plugins/opencontrail/ContrailPlugin.ini # (optional) Manage configuration of plugins/opencontrail/ContrailPlugin.ini
# #
@ -107,6 +104,9 @@
# [*plugin_cisco_config*] # [*plugin_cisco_config*]
# (optional) Manage configuration of cisco_plugins.ini # (optional) Manage configuration of cisco_plugins.ini
# #
# [*plugin_plumgrid_config*]
# (optional) Manage configuration of plugins/plumgrid/plumgrid.ini
#
# NOTE: The configuration MUST NOT be already handled by this module # NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources. # or Puppet catalog compilation will fail with duplicate resources.
# #
@ -129,7 +129,6 @@ class neutron::config (
$bgp_dragent_config = {}, $bgp_dragent_config = {},
$plugin_linuxbridge_config = {}, $plugin_linuxbridge_config = {},
$plugin_midonet_config = {}, $plugin_midonet_config = {},
$plugin_plumgrid_config = {},
$plugin_opencontrail_config = {}, $plugin_opencontrail_config = {},
$plugin_nuage_config = {}, $plugin_nuage_config = {},
$plugin_ml2_config = {}, $plugin_ml2_config = {},
@ -140,10 +139,15 @@ class neutron::config (
$plugin_cisco_db_conn_config = undef, $plugin_cisco_db_conn_config = undef,
$plugin_cisco_l2network_config = undef, $plugin_cisco_l2network_config = undef,
$plugin_cisco_config = undef, $plugin_cisco_config = undef,
$plugin_plumgrid_config = undef,
) { ) {
include neutron::deps include neutron::deps
if $plugin_plumgrid_config != undef {
warning('The plugin_plumgrid_config parameter was deprecated and has no effect')
}
if $api_config != undef { if $api_config != undef {
warning('The neutron::config::api_config parameter has been deprecated and \ warning('The neutron::config::api_config parameter has been deprecated and \
will be removed in a future release. Use the api_paste_ini parameter instead.') will be removed in a future release. Use the api_paste_ini parameter instead.')
@ -182,7 +186,6 @@ will be removed in a future release. Use the api_paste_ini parameter instead.')
validate_legacy(Hash, 'validate_hash', $bgp_dragent_config) validate_legacy(Hash, 'validate_hash', $bgp_dragent_config)
validate_legacy(Hash, 'validate_hash', $plugin_linuxbridge_config) validate_legacy(Hash, 'validate_hash', $plugin_linuxbridge_config)
validate_legacy(Hash, 'validate_hash', $plugin_midonet_config) validate_legacy(Hash, 'validate_hash', $plugin_midonet_config)
validate_legacy(Hash, 'validate_hash', $plugin_plumgrid_config)
validate_legacy(Hash, 'validate_hash', $plugin_opencontrail_config) validate_legacy(Hash, 'validate_hash', $plugin_opencontrail_config)
validate_legacy(Hash, 'validate_hash', $plugin_nuage_config) validate_legacy(Hash, 'validate_hash', $plugin_nuage_config)
validate_legacy(Hash, 'validate_hash', $plugin_ml2_config) validate_legacy(Hash, 'validate_hash', $plugin_ml2_config)
@ -205,7 +208,6 @@ will be removed in a future release. Use the api_paste_ini parameter instead.')
create_resources('neutron_bgp_dragent_config', $bgp_dragent_config) create_resources('neutron_bgp_dragent_config', $bgp_dragent_config)
create_resources('neutron_plugin_linuxbridge', $plugin_linuxbridge_config) create_resources('neutron_plugin_linuxbridge', $plugin_linuxbridge_config)
create_resources('neutron_plugin_midonet', $plugin_midonet_config) create_resources('neutron_plugin_midonet', $plugin_midonet_config)
create_resources('neutron_plugin_plumgrid', $plugin_plumgrid_config)
create_resources('neutron_plugin_opencontrail', $plugin_opencontrail_config) create_resources('neutron_plugin_opencontrail', $plugin_opencontrail_config)
create_resources('neutron_plugin_nuage', $plugin_nuage_config) create_resources('neutron_plugin_nuage', $plugin_nuage_config)
create_resources('neutron_plugin_ml2', $plugin_ml2_config) create_resources('neutron_plugin_ml2', $plugin_ml2_config)

View File

@ -60,9 +60,7 @@ class neutron::deps {
Anchor['neutron::config::begin'] -> Neutron_plugin_nuage<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_plugin_nuage<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_nvp<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_plugin_nvp<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_opencontrail<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_plugin_opencontrail<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_plumgrid<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_sriov<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_plugin_sriov<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plumlib_plumgrid<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_sriov_agent_config<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_sriov_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_vpnaas_agent_config<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_vpnaas_agent_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_vpnaas_service_config<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_vpnaas_service_config<||> ~> Anchor['neutron::config::end']

View File

@ -25,7 +25,7 @@
# (optional) Neutron plugin provider # (optional) Neutron plugin provider
# Defaults to ml2 # Defaults to ml2
# Could be bigswitch, brocade, cisco, embrane, hyperv, midonet, # Could be bigswitch, brocade, cisco, embrane, hyperv, midonet,
# ml2, mlnx, nec, nicira, plumgrid, ryu, nuage, opencontrail, nsx # ml2, mlnx, nec, nicira, ryu, nuage, opencontrail, nsx
# #
# Example for nuage: # Example for nuage:
# #

View File

@ -19,9 +19,6 @@ class neutron::params {
$ovn_plugin_package = "python${pyvers}-networking-ovn" $ovn_plugin_package = "python${pyvers}-networking-ovn"
$vpp_plugin_package = "python${pyvers}-networking-vpp" $vpp_plugin_package = "python${pyvers}-networking-vpp"
$vpp_agent_service = 'neutron-vpp-agent' $vpp_agent_service = 'neutron-vpp-agent'
$plumgrid_plugin_package = 'networking-plumgrid'
$plumgrid_pythonlib_package = 'plumgrid-pythonlib'
$plumgrid_config_file = '/etc/neutron/plugins/plumgrid/plumgrid.ini'
$nuage_config_file = '/etc/neutron/plugins/nuage/plugin.ini' $nuage_config_file = '/etc/neutron/plugins/nuage/plugin.ini'
$dhcp_agent_service = 'neutron-dhcp-agent' $dhcp_agent_service = 'neutron-dhcp-agent'
$haproxy_package = 'haproxy' $haproxy_package = 'haproxy'

View File

@ -1,203 +0,0 @@
# This class installs and configures Plumgrid Neutron Plugin.
#
# === Parameters
#
# [*director_server*]
# IP address of the PLUMgrid Director Server
# Defaults to 127.0.0.1
#
# [*director_server_port*]
# Port of the PLUMgrid Director Server.
# Defaults to 443
#
# [*username*]
# PLUMgrid platform username
# Defaults to $::os_service_default
#
# [*password*]
# PLUMgrid platform password
# Defaults to $::os_service_default
#
# [*servertimeout*]
# Request timeout duration (seconds) to PLUMgrid paltform
# Defaults to 99
#
# [*connection*]
# Database connection
# Defaults to http://127.0.0.1:5000/v3
#
# [*admin_password*]
# Keystone admin password
# Defaults to $::os_service_default
#
# [*controller_priv_host*]
# Controller private host IP
# Defaults to 127.0.0.1
#
# [*auth_protocol*]
# Authorization protocol
# Defaults to http
#
# [*identity_version*]
# Keystone identity version
# Defaults to v3
#
# [*user_domain_name*]
# Keystone user domain name
# Defaults to Default
#
# [*nova_metadata_ip*]
# Nova metadata IP
# Defaults to 127.0.0.1
#
# [*nova_metadata_host*]
# Nova metadata host
# Defaults to 127.0.0.1
#
# [*nova_metadata_port*]
# Nova metadata port
# Defaults to 8775
#
# [*nova_metadata_subnet*]
# Nova metadata subnet
# Defaults to 127.0.0.1/24
#
# [*metadata_proxy_shared_secret*]
# Neutron metadata shared secret key
# Defaults to $::os_service_default
#
# [*connector_type*]
# Neutron network connector type
# Defaults to distributed
#
# [*l2gateway_vendor*]
# L2 gateway vendor
# Defaults to $::os_service_default
#
# [*l2gateway_sw_username*]
# L2 gateway username
# Defaults to $::os_service_default
#
# [*l2gateway_sw_password*]
# L2 gateway password
# Defaults to $::os_service_default
#
# [*plumlib_package_ensure*]
# (optional) Ensure state for plumlib package.
# Defaults to 'present'.
#
# [*package_ensure*]
# (optional) Ensure state for plugin package.
# Defaults to 'present'.
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the plumgrid config.
# Defaults to false.
#
class neutron::plugins::plumgrid (
$director_server = '127.0.0.1',
$director_server_port = '443',
$username = $::os_service_default,
$password = $::os_service_default,
$servertimeout = '99',
$connection = 'http://127.0.0.1:5000/v3',
$admin_password = $::os_service_default,
$controller_priv_host = '127.0.0.1',
$auth_protocol = 'http',
$identity_version = 'v3',
$user_domain_name = 'Default',
$nova_metadata_ip = '127.0.0.1',
$nova_metadata_host = '127.0.0.1',
$nova_metadata_port = '8775',
$nova_metadata_subnet = '127.0.0.1/24',
$metadata_proxy_shared_secret = $::os_service_default,
$connector_type = 'distributed',
$l2gateway_vendor = $::os_service_default,
$l2gateway_sw_username = $::os_service_default,
$l2gateway_sw_password = $::os_service_default,
$plumlib_package_ensure = 'present',
$package_ensure = 'present',
$purge_config = false,
) {
include neutron::deps
include neutron::params
warning('support for plumgrid plugin has been deprecated and will be removed \
in a future release.')
ensure_resource('file', '/etc/neutron/plugins/plumgrid', {
ensure => directory,
owner => 'root',
group => 'neutron',
mode => '0640'}
)
package { 'neutron-plugin-plumgrid':
ensure => $package_ensure,
name => $::neutron::params::plumgrid_plugin_package
}
package { 'neutron-plumlib-plumgrid':
ensure => $plumlib_package_ensure,
name => $::neutron::params::plumgrid_pythonlib_package
}
if $::osfamily == 'Debian' {
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
path => '/etc/default/neutron-server',
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
line => "NEUTRON_PLUGIN_CONFIG=${::neutron::params::plumgrid_config_file}",
tag => 'neutron-file-line',
}
}
if $::osfamily == 'Redhat' {
file { '/etc/neutron/plugin.ini':
ensure => link,
target => $::neutron::params::plumgrid_config_file,
tag => 'neutron-config-file',
}
}
resources { 'neutron_plugin_plumgrid':
purge => $purge_config,
}
resources { 'neutron_plumlib_plumgrid':
purge => $purge_config,
}
neutron_plugin_plumgrid {
'PLUMgridDirector/director_server': value => $director_server;
'PLUMgridDirector/director_server_port': value => $director_server_port;
'PLUMgridDirector/username': value => $username;
'PLUMgridDirector/password': value => $password, secret =>true;
'PLUMgridDirector/servertimeout': value => $servertimeout;
'database/connection': value => $connection;
'l2gateway/vendor': value => $l2gateway_vendor;
'l2gateway/sw_username': value => $l2gateway_sw_username;
'l2gateway/sw_password': value => $l2gateway_sw_password, secret =>true;
}
neutron_plumlib_plumgrid {
'keystone_authtoken/admin_user' : value => 'admin';
'keystone_authtoken/admin_password': value => $admin_password, secret =>true;
# TODO(tobias-urdin): Remove auth_uri when we know www_authenticate_uri is working until then
# we keep duplicates here.
'keystone_authtoken/auth_uri': value => "${auth_protocol}://${controller_priv_host}:5000/${identity_version}";
'keystone_authtoken/www_authenticate_uri': value => "${auth_protocol}://${controller_priv_host}:5000/${identity_version}";
'keystone_authtoken/admin_tenant_name': value => 'admin';
'keystone_authtoken/identity_version': value => $identity_version;
'keystone_authtoken/user_domain_name': value => $user_domain_name;
'PLUMgridMetadata/enable_pg_metadata' : value => 'True';
'PLUMgridMetadata/metadata_mode': value => 'local';
'PLUMgridMetadata/nova_metadata_ip': value => $nova_metadata_ip;
'PLUMgridMetadata/nova_metadata_host': value => $nova_metadata_host;
'PLUMgridMetadata/nova_metadata_port': value => $nova_metadata_port;
'PLUMgridMetadata/nova_metadata_subnet': value => $nova_metadata_subnet;
'PLUMgridMetadata/metadata_proxy_shared_secret': value => $metadata_proxy_shared_secret, secret =>true;
'ConnectorType/connector_type': value => $connector_type;
}
}

View File

@ -0,0 +1,10 @@
---
upgrade:
- |
Support for plumgrid plugin has been removed.
deprecations:
- |
The ``neutron::config::plugin_plumgrid_config`` parameter has been
deprecated. This parameter has no effect, since support for plumgrid plugin
has been removed.

View File

@ -21,7 +21,6 @@ describe 'basic neutron_config resource' do
'/etc/neutron/vpn_agent.ini', '/etc/neutron/vpn_agent.ini',
'/etc/neutron/plugins/midonet/midonet.ini', '/etc/neutron/plugins/midonet/midonet.ini',
'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini', '/etc/neutron/plugins/opencontrail/ContrailPlugin.ini',
'/etc/neutron/plugins/plumgrid/plumgrid.ini',
'/etc/neutron/plugins/vmware/nsx.ini', '/etc/neutron/plugins/vmware/nsx.ini',
'/etc/neutron/plugins/ml2/ml2_conf_sriov.ini', '/etc/neutron/plugins/ml2/ml2_conf_sriov.ini',
'/etc/neutron/plugins/ml2/sriov_agent.ini', '/etc/neutron/plugins/ml2/sriov_agent.ini',
@ -50,8 +49,6 @@ describe 'basic neutron_config resource' do
File <||> -> Neutron_plugin_opencontrail <||> File <||> -> Neutron_plugin_opencontrail <||>
File <||> -> Neutron_agent_linuxbridge <||> File <||> -> Neutron_agent_linuxbridge <||>
File <||> -> Neutron_agent_ovs <||> File <||> -> Neutron_agent_ovs <||>
File <||> -> Neutron_plugin_plumgrid <||>
File <||> -> Neutron_plumlib_plumgrid <||>
File <||> -> Neutron_plugin_sriov <||> File <||> -> Neutron_plugin_sriov <||>
File <||> -> Neutron_sriov_agent_config <||> File <||> -> Neutron_sriov_agent_config <||>
File <||> -> Neutron_agent_vpp <||> File <||> -> Neutron_agent_vpp <||>
@ -67,7 +64,6 @@ describe 'basic neutron_config resource' do
'/etc/neutron/plugins/nicira', '/etc/neutron/plugins/nicira',
'/etc/neutron/plugins/midonet', '/etc/neutron/plugins/midonet',
'/etc/neutron/plugins/opencontrail', '/etc/neutron/plugins/opencontrail',
'/etc/neutron/plugins/plumgrid',
'/etc/neutron/plugins/vmware'] '/etc/neutron/plugins/vmware']
$neutron_files = [ '/etc/neutron/api-paste.ini', $neutron_files = [ '/etc/neutron/api-paste.ini',
@ -89,7 +85,6 @@ describe 'basic neutron_config resource' do
'/etc/neutron/vpn_agent.ini', '/etc/neutron/vpn_agent.ini',
'/etc/neutron/plugins/midonet/midonet.ini', '/etc/neutron/plugins/midonet/midonet.ini',
'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini', '/etc/neutron/plugins/opencontrail/ContrailPlugin.ini',
'/etc/neutron/plugins/plumgrid/plumgrid.ini',
'/etc/neutron/plugins/vmware/nsx.ini', '/etc/neutron/plugins/vmware/nsx.ini',
'/etc/neutron/plugins/ml2/ml2_conf_sriov.ini', '/etc/neutron/plugins/ml2/ml2_conf_sriov.ini',
'/etc/neutron/plugins/ml2/sriov_agent.ini', '/etc/neutron/plugins/ml2/sriov_agent.ini',
@ -444,41 +439,6 @@ describe 'basic neutron_config resource' do
ensure_absent_val => 'toto', ensure_absent_val => 'toto',
} }
neutron_plugin_plumgrid { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
neutron_plugin_plumgrid { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
neutron_plugin_plumgrid { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
neutron_plugin_plumgrid { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
neutron_plumlib_plumgrid { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
neutron_plumlib_plumgrid { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
neutron_plumlib_plumgrid { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto', }
neutron_plumlib_plumgrid { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
neutron_plugin_nsx { 'DEFAULT/thisshouldexist' : neutron_plugin_nsx { 'DEFAULT/thisshouldexist' :
value => 'foo', value => 'foo',
} }
@ -608,7 +568,6 @@ describe 'basic neutron_config resource' do
'neutron_plugin_opencontrail', 'neutron_plugin_opencontrail',
'neutron_agent_linuxbridge', 'neutron_agent_linuxbridge',
'neutron_agent_ovs', 'neutron_agent_ovs',
'neutron_plugin_plumgrid',
'neutron_plugin_sriov', 'neutron_plugin_sriov',
'neutron_sriov_agent_config', 'neutron_sriov_agent_config',
'neutron_agent_vpp', 'neutron_agent_vpp',

View File

@ -129,7 +129,6 @@ describe 'neutron::config' do
{ {
:plugin_linuxbridge_config => config_hash, :plugin_linuxbridge_config => config_hash,
:plugin_midonet_config => config_hash, :plugin_midonet_config => config_hash,
:plugin_plumgrid_config => config_hash,
:plugin_nsx_config => config_hash, :plugin_nsx_config => config_hash,
:plugin_nvp_config => config_hash, :plugin_nvp_config => config_hash,
:plugin_opencontrail_config => config_hash, :plugin_opencontrail_config => config_hash,
@ -150,12 +149,6 @@ describe 'neutron::config' do
should contain_neutron_plugin_midonet('DEFAULT/baz').with_ensure('absent') should contain_neutron_plugin_midonet('DEFAULT/baz').with_ensure('absent')
end end
it 'configures arbitrary neutron_plugin_plumgrid configurations' do
should contain_neutron_plugin_plumgrid('DEFAULT/foo').with_value('fooValue')
should contain_neutron_plugin_plumgrid('DEFAULT/bar').with_value('barValue')
should contain_neutron_plugin_plumgrid('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary neutron_plugin_nsx configurations' do it 'configures arbitrary neutron_plugin_nsx configurations' do
should contain_neutron_plugin_nsx('DEFAULT/foo').with_value('fooValue') should contain_neutron_plugin_nsx('DEFAULT/foo').with_value('fooValue')
should contain_neutron_plugin_nsx('DEFAULT/bar').with_value('barValue') should contain_neutron_plugin_nsx('DEFAULT/bar').with_value('barValue')

View File

@ -1,130 +0,0 @@
require 'spec_helper'
describe 'neutron::plugins::plumgrid' do
let :pre_condition do
"class { 'neutron::keystone::authtoken':
password => 'passw0rd',
}
class { 'neutron::server': }
class { 'neutron': }"
end
let :default_params do
{
:director_server => '127.0.0.1',
:director_server_port => '443',
:servertimeout => '99',
:connection => 'http://127.0.0.1:5000/v3',
:controller_priv_host => '127.0.0.1',
:auth_protocol => 'http',
:identity_version => 'v3',
:user_domain_name => 'Default',
:nova_metadata_ip => '127.0.0.1',
:nova_metadata_host => '127.0.0.1',
:nova_metadata_port => '8775',
:nova_metadata_subnet => '127.0.0.1/24',
:connector_type => 'distributed',
:purge_config => false,
}
end
shared_examples 'neutron plumgrid plugin' do
let :params do
{}
end
before do
params.merge!(default_params)
end
it 'installs plumgrid plugin package' do
should contain_package('neutron-plugin-plumgrid').with(
:ensure => 'present'
)
end
it 'installs plumgrid plumlib package' do
should contain_package('neutron-plumlib-plumgrid').with(
:ensure => 'present'
)
end
it 'passes purge to resource plugin_plumgrid' do
should contain_resources('neutron_plugin_plumgrid').with({
:purge => false
})
end
it 'passes purge to resource plumlib_plumgrid' do
should contain_resources('neutron_plumlib_plumgrid').with({
:purge => false
})
end
it 'should perform default configuration of plumgrid plugin' do
should contain_neutron_plugin_plumgrid('PLUMgridDirector/director_server').with_value(params[:director_server])
should contain_neutron_plugin_plumgrid('PLUMgridDirector/director_server_port').with_value(params[:director_server_port])
should contain_neutron_plugin_plumgrid('PLUMgridDirector/username').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_plumgrid('PLUMgridDirector/password').with_value('<SERVICE DEFAULT>').with_secret(true)
should contain_neutron_plugin_plumgrid('PLUMgridDirector/servertimeout').with_value(params[:servertimeout])
should contain_neutron_plugin_plumgrid('database/connection').with_value(params[:connection])
should contain_neutron_plugin_plumgrid('l2gateway/vendor').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_plumgrid('l2gateway/sw_username').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_plumgrid('l2gateway/sw_password').with_value('<SERVICE DEFAULT>').with_secret(true)
end
it 'should perform default configuration of plumgrid plumlib' do
auth_uri = params[:auth_protocol] + "://" + params[:controller_priv_host] + ":" + "5000/" + params[:identity_version];
should contain_neutron_plumlib_plumgrid('keystone_authtoken/auth_uri').with_value(auth_uri)
should contain_neutron_plumlib_plumgrid('keystone_authtoken/www_authenticate_uri').with_value(auth_uri)
should contain_neutron_plumlib_plumgrid('keystone_authtoken/identity_version').with_value(params[:identity_version])
should contain_neutron_plumlib_plumgrid('keystone_authtoken/user_domain_name').with_value(params[:user_domain_name])
should contain_neutron_plumlib_plumgrid('PLUMgridMetadata/enable_pg_metadata').with_value('True')
should contain_neutron_plumlib_plumgrid('PLUMgridMetadata/metadata_mode').with_value('local')
should contain_neutron_plumlib_plumgrid('PLUMgridMetadata/nova_metadata_ip').with_value(params[:nova_metadata_ip])
should contain_neutron_plumlib_plumgrid('PLUMgridMetadata/nova_metadata_host').with_value(params[:nova_metadata_host])
should contain_neutron_plumlib_plumgrid('PLUMgridMetadata/nova_metadata_port').with_value(params[:nova_metadata_port])
should contain_neutron_plumlib_plumgrid('PLUMgridMetadata/nova_metadata_subnet').with_value(params[:nova_metadata_subnet])
should contain_neutron_plumlib_plumgrid('PLUMgridMetadata/metadata_proxy_shared_secret').with_value('<SERVICE DEFAULT>').with_secret(true)
should contain_neutron_plumlib_plumgrid('ConnectorType/connector_type').with_value('distributed')
end
end
shared_examples 'neutron::plugins::plumgrid on Debian' do
it 'configures /etc/default/neutron-server' do
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
:path => '/etc/default/neutron-server',
:match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/plumgrid/plumgrid.ini',
:tag => 'neutron-file-line',
)
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').that_requires('Anchor[neutron::config::begin]')
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').that_notifies('Anchor[neutron::config::end]')
end
end
shared_examples 'neutron::plugins::plumgrid on RedHat' do
it 'should create plugin symbolic link' do
should contain_file('/etc/neutron/plugin.ini').with(
:ensure => 'link',
:target => '/etc/neutron/plugins/plumgrid/plumgrid.ini',
:tag => 'neutron-config-file')
should contain_file('/etc/neutron/plugin.ini').that_requires('Anchor[neutron::config::begin]')
should contain_file('/etc/neutron/plugin.ini').that_notifies('Anchor[neutron::config::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 plumgrid plugin'
it_behaves_like "neutron::plugins::plumgrid on #{facts[:osfamily]}"
end
end
end

View File

@ -1,47 +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_plugin_plumgrid).provider(:ini_setting)
describe provider_class do
let(:resource ) do
Puppet::Type::Neutron_plugin_plumgrid.new({
:name => 'DEFAULT/foo',
:value => 'bar',
})
end
let (:provider) { resource.provider }
[ 'RedHat', 'Debian' ].each do |os|
context "on #{os} with default setting" do
it 'it should fall back to default and use plumgrid.ini' do
Facter.fact(:operatingsystem).stubs(:value).returns("#{os}")
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/plumgrid/plumgrid.ini')
end
end
end
end

View File

@ -1,47 +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_plumlib_plumgrid).provider(:ini_setting)
describe provider_class do
let(:resource ) do
Puppet::Type::Neutron_plumlib_plumgrid.new({
:name => 'DEFAULT/foo',
:value => 'bar',
})
end
let (:provider) { resource.provider }
[ 'RedHat', 'Debian' ].each do |os|
context "on #{os} with default setting" do
it 'it should fall back to default and use plumlib.ini' do
Facter.fact(:operatingsystem).stubs(:value).returns("#{os}")
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/plumgrid/plumlib.ini')
end
end
end
end

View File

@ -1,20 +0,0 @@
require 'puppet'
require 'puppet/type/neutron_plugin_plumgrid'
describe 'Puppet::Type.type(:neutron_plugin_plumgrid)' do
before :each do
@neutron_plugin_plumgrid = Puppet::Type.type(:neutron_plugin_plumgrid).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_plugin_plumgrid
dependency = @neutron_plugin_plumgrid.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@neutron_plugin_plumgrid)
expect(dependency[0].source).to eq(anchor)
end
end

View File

@ -1,20 +0,0 @@
require 'puppet'
require 'puppet/type/neutron_plumlib_plumgrid'
describe 'Puppet::Type.type(:neutron_plumlib_plumgrid)' do
before :each do
@neutron_plumlib_plumgrid = Puppet::Type.type(:neutron_plumlib_plumgrid).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_plumlib_plumgrid
dependency = @neutron_plumlib_plumgrid.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@neutron_plumlib_plumgrid)
expect(dependency[0].source).to eq(anchor)
end
end