Remove support for NSX plugin
It was deprecated during Zed cycle by [1], because the plugin is no
longer maintained.
[1] c148a64307
Change-Id: I95feecae2e3beaed00b4a8da4c2340a0006993c8
This commit is contained in:
parent
8e007943dc
commit
ed0709cb48
@ -1,15 +0,0 @@
|
||||
Puppet::Type.type(:neutron_plugin_nsx).provide(
|
||||
:ini_setting,
|
||||
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
|
||||
) do
|
||||
|
||||
def self.file_path
|
||||
'/etc/neutron/plugins/vmware/nsx.ini'
|
||||
end
|
||||
|
||||
# added for backwards compatibility with older versions of inifile
|
||||
def file_path
|
||||
self.class.file_path
|
||||
end
|
||||
|
||||
end
|
@ -1,56 +0,0 @@
|
||||
Puppet::Type.newtype(:neutron_plugin_nsx) do
|
||||
|
||||
ensurable
|
||||
|
||||
newparam(:name, :namevar => true) do
|
||||
desc 'Section/setting name to manage from vmware/nsx.ini (DEPRECATED)'
|
||||
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/vmware'
|
||||
end
|
||||
|
||||
autorequire(:anchor) do
|
||||
['neutron::install::end']
|
||||
end
|
||||
|
||||
end
|
@ -83,9 +83,6 @@
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*plugin_nsx_config*]
|
||||
# (optional) Manage configuration of plugins/vmware/nsx.ini
|
||||
#
|
||||
# [*linuxbridge_agent_config*]
|
||||
# (optional) Manage configuration of linuxbridge_agent.ini
|
||||
#
|
||||
@ -114,19 +111,11 @@ class neutron::config (
|
||||
$plugin_nuage_config = {},
|
||||
$plugin_ml2_config = {},
|
||||
# DEPRECATED PARAMETERS
|
||||
$plugin_nsx_config = undef,
|
||||
$linuxbridge_agent_config = undef,
|
||||
) {
|
||||
|
||||
include neutron::deps
|
||||
|
||||
if $plugin_nsx_config != undef {
|
||||
warning('The plugin_nsx_config parameter is deprecated.')
|
||||
$plugin_nsx_config_real = $plugin_nsx_config
|
||||
} else {
|
||||
$plugin_nsx_config_real = {}
|
||||
}
|
||||
|
||||
if $linuxbridge_agent_config != undef {
|
||||
warning('The linuxbridge_agent_config parameter is deprecated.')
|
||||
$linuxbridge_agent_config_real = $linuxbridge_agent_config
|
||||
@ -155,7 +144,6 @@ class neutron::config (
|
||||
validate_legacy(Hash, 'validate_hash', $plugin_opencontrail_config)
|
||||
validate_legacy(Hash, 'validate_hash', $plugin_nuage_config)
|
||||
validate_legacy(Hash, 'validate_hash', $plugin_ml2_config)
|
||||
validate_legacy(Hash, 'validate_hash', $plugin_nsx_config_real)
|
||||
|
||||
create_resources('neutron_config', $server_config)
|
||||
create_resources('neutron_api_paste_ini', $api_paste_ini)
|
||||
@ -178,5 +166,4 @@ class neutron::config (
|
||||
create_resources('neutron_plugin_opencontrail', $plugin_opencontrail_config)
|
||||
create_resources('neutron_plugin_nuage', $plugin_nuage_config)
|
||||
create_resources('neutron_plugin_ml2', $plugin_ml2_config)
|
||||
create_resources('neutron_plugin_nsx', $plugin_nsx_config_real)
|
||||
}
|
||||
|
@ -55,7 +55,6 @@ class neutron::deps {
|
||||
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_service_config<||> ~> Anchor['neutron::config::end']
|
||||
Anchor['neutron::config::begin'] -> Neutron_plugin_nsx<||> ~> Anchor['neutron::config::end']
|
||||
Anchor['neutron::config::begin'] -> Neutron_rootwrap_config<||> ~> Anchor['neutron::config::end']
|
||||
Anchor['neutron::config::begin'] -> Ovn_metadata_agent_config<||> ~> Anchor['neutron::config::end']
|
||||
Anchor['neutron::config::begin'] -> Ironic_neutron_agent_config<||> ~> Anchor['neutron::config::end']
|
||||
|
@ -26,8 +26,6 @@ class neutron::params {
|
||||
$bgpvpn_bagpipe_service = 'bagpipe-bgp'
|
||||
$bgpvpn_plugin_package = 'python3-networking-bgpvpn'
|
||||
$l2gw_agent_service = 'neutron-l2gw-agent'
|
||||
$nsx_plugin_package = 'vmware-nsx'
|
||||
$nsx_config_file = '/etc/neutron/plugins/vmware/nsx.ini'
|
||||
$sfc_package = 'python3-networking-sfc'
|
||||
$user = 'neutron'
|
||||
$group = 'neutron'
|
||||
|
@ -1,152 +0,0 @@
|
||||
#
|
||||
# DEPRECATED !!
|
||||
# Configure the VMware NSX plugin for neutron.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*default_overlay_tz*]
|
||||
# (Optional) Name or UUID of the default overlay Transport Zone to be used
|
||||
# for creating tunneled isolated "Neutron" networks. This option MUST be
|
||||
# specified.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*default_vlan_tz*]
|
||||
# (Optional) Name or UUID of the default VLAN Transport Zone to be used for
|
||||
# creating VLAN networks.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*default_bridge_cluster*]
|
||||
# (Optional) Name or UUID of the default NSX bridge cluster that will be
|
||||
# used to perform L2 gateway bridging between VXLAN and VLAN networks.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*default_tier0_router*]
|
||||
# (Optional) Name or UUID of the pre-created default tier0 (provider) router
|
||||
# on NSX backend. This option is used to create external networks and MUST be
|
||||
# specified.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*nsx_api_managers*]
|
||||
# (Optional) Comma separated NSX manager IP addresses. This option MUST be
|
||||
# specified.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*nsx_api_user*]
|
||||
# (Optional) The username for NSX manager.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*nsx_api_password*]
|
||||
# (Optional) The password for NSX manager.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*dhcp_profile*]
|
||||
# (Optional) Name or UUID of the pre-created DHCP profile on NSX backend to
|
||||
# support native DHCP. This option MUST be specified if native_dhcp_metadata
|
||||
# is True.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*dhcp_relay_service*]
|
||||
# (Optional) This is the name or UUID of the NSX relay service that will be
|
||||
# used to enable DHCP relay on router ports.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*metadata_proxy*]
|
||||
# (Optional) Name or UUID of the pre-created Metadata Proxy on NSX backend.
|
||||
# This option MUST be specified if native_dhcp_metadata is True.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*native_dhcp_metadata*]
|
||||
# (Optional) Flag to enable native DHCP and Metadata.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package.
|
||||
# Defaults to 'present'.
|
||||
#
|
||||
# [*purge_config*]
|
||||
# (Optional) Whether to set only the specified config options
|
||||
# in the nvp config.
|
||||
# Defaults to false.
|
||||
#
|
||||
class neutron::plugins::nsx (
|
||||
$default_overlay_tz = $::os_service_default,
|
||||
$default_vlan_tz = $::os_service_default,
|
||||
$default_bridge_cluster = $::os_service_default,
|
||||
$default_tier0_router = $::os_service_default,
|
||||
$nsx_api_managers = $::os_service_default,
|
||||
$nsx_api_user = $::os_service_default,
|
||||
$nsx_api_password = $::os_service_default,
|
||||
$dhcp_profile = $::os_service_default,
|
||||
$dhcp_relay_service = $::os_service_default,
|
||||
$metadata_proxy = $::os_service_default,
|
||||
$native_dhcp_metadata = $::os_service_default,
|
||||
$package_ensure = 'present',
|
||||
$purge_config = false,
|
||||
) {
|
||||
|
||||
include neutron::deps
|
||||
include neutron::params
|
||||
|
||||
warning('Support for NSX plugin has been deprecated and will be removed.')
|
||||
|
||||
package { 'vmware-nsx':
|
||||
ensure => $package_ensure,
|
||||
name => $::neutron::params::nsx_plugin_package,
|
||||
tag => ['openstack', 'neutron-package'],
|
||||
}
|
||||
|
||||
file { '/etc/neutron/plugins/vmware':
|
||||
ensure => directory,
|
||||
tag => 'neutron-config-file',
|
||||
}
|
||||
|
||||
file { $::neutron::params::nsx_config_file:
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => $::neutron::params::group,
|
||||
require => File['/etc/neutron/plugins/vmware'],
|
||||
mode => '0640',
|
||||
tag => 'neutron-config-file',
|
||||
}
|
||||
|
||||
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::nsx_config_file}",
|
||||
tag => 'neutron-file-line',
|
||||
}
|
||||
}
|
||||
|
||||
if $::osfamily == 'Redhat' {
|
||||
file { '/etc/neutron/plugin.ini':
|
||||
ensure => link,
|
||||
require => File[$::neutron::params::nsx_config_file],
|
||||
target => $::neutron::params::nsx_config_file,
|
||||
tag => 'neutron-config-file',
|
||||
}
|
||||
}
|
||||
|
||||
resources { 'neutron_plugin_nsx':
|
||||
purge => $purge_config,
|
||||
}
|
||||
|
||||
neutron_plugin_nsx {
|
||||
'nsx_v3/default_overlay_tz': value => $default_overlay_tz;
|
||||
'nsx_v3/default_vlan_tz': value => $default_vlan_tz;
|
||||
'nsx_v3/default_bridge_cluster': value => $default_bridge_cluster;
|
||||
'nsx_v3/default_tier0_router': value => $default_tier0_router;
|
||||
'nsx_v3/nsx_api_managers': value => join(any2array($nsx_api_managers), ',');
|
||||
'nsx_v3/nsx_api_user': value => $nsx_api_user;
|
||||
'nsx_v3/nsx_api_password': value => $nsx_api_password, secret => true;
|
||||
'nsx_v3/dhcp_profile': value => $dhcp_profile;
|
||||
'nsx_v3/dhcp_relay_service': value => $dhcp_relay_service;
|
||||
'nsx_v3/metadata_proxy': value => $metadata_proxy;
|
||||
'nsx_v3/native_dhcp_metadata': value => $native_dhcp_metadata;
|
||||
}
|
||||
|
||||
if ($::neutron::core_plugin != 'vmware_nsx.plugin.NsxV3Plugin') and
|
||||
($::neutron::core_plugin != 'nsx') {
|
||||
fail('VMware NSX plugin should be the core_plugin in neutron.conf')
|
||||
}
|
||||
}
|
4
releasenotes/notes/remove-nsx-b6c2e9abcc6ccedd.yaml
Normal file
4
releasenotes/notes/remove-nsx-b6c2e9abcc6ccedd.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
Support for the NSX plugin has been removed.
|
@ -13,7 +13,6 @@ describe 'basic neutron_config resource' do
|
||||
'/etc/neutron/plugins/ml2/ml2_conf.ini',
|
||||
'/etc/neutron/vpn_agent.ini',
|
||||
'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini',
|
||||
'/etc/neutron/plugins/vmware/nsx.ini',
|
||||
'/etc/neutron/plugins/ml2/sriov_agent.ini',
|
||||
'/etc/neutron/plugins/ml2/vpp_agent.ini']
|
||||
|
||||
@ -35,14 +34,12 @@ describe 'basic neutron_config resource' do
|
||||
File <||> -> Neutron_sriov_agent_config <||>
|
||||
File <||> -> Neutron_agent_vpp <||>
|
||||
File <||> -> Neutron_l2gw_agent_config <||>
|
||||
File <||> -> Neutron_plugin_nsx <||>
|
||||
|
||||
|
||||
$neutron_directories = ['/etc/neutron',
|
||||
'/etc/neutron/plugins',
|
||||
'/etc/neutron/plugins/ml2',
|
||||
'/etc/neutron/plugins/opencontrail',
|
||||
'/etc/neutron/plugins/vmware']
|
||||
'/etc/neutron/plugins/opencontrail']
|
||||
|
||||
$neutron_files = [ '/etc/neutron/api-paste.ini',
|
||||
'/etc/neutron/neutron.conf',
|
||||
@ -55,7 +52,6 @@ describe 'basic neutron_config resource' do
|
||||
'/etc/neutron/plugins/ml2/ml2_conf.ini',
|
||||
'/etc/neutron/vpn_agent.ini',
|
||||
'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini',
|
||||
'/etc/neutron/plugins/vmware/nsx.ini',
|
||||
'/etc/neutron/plugins/ml2/sriov_agent.ini',
|
||||
'/etc/neutron/plugins/ml2/vpp_agent.ini']
|
||||
|
||||
@ -264,24 +260,6 @@ describe 'basic neutron_config resource' do
|
||||
ensure_absent_val => 'toto',
|
||||
}
|
||||
|
||||
neutron_plugin_nsx { 'DEFAULT/thisshouldexist' :
|
||||
value => 'foo',
|
||||
}
|
||||
|
||||
neutron_plugin_nsx { 'DEFAULT/thisshouldnotexist' :
|
||||
value => '<SERVICE DEFAULT>',
|
||||
}
|
||||
|
||||
neutron_plugin_nsx { 'DEFAULT/thisshouldexist2' :
|
||||
value => '<SERVICE DEFAULT>',
|
||||
ensure_absent_val => 'toto',
|
||||
}
|
||||
|
||||
neutron_plugin_nsx { 'DEFAULT/thisshouldnotexist2' :
|
||||
value => 'toto',
|
||||
ensure_absent_val => 'toto',
|
||||
}
|
||||
|
||||
neutron_sriov_agent_config { 'DEFAULT/thisshouldexist' :
|
||||
value => 'foo',
|
||||
}
|
||||
|
@ -141,19 +141,12 @@ describe 'neutron::config' do
|
||||
shared_examples 'neutron_plugin_config' do
|
||||
let :params do
|
||||
{
|
||||
:plugin_nsx_config => config_hash,
|
||||
:plugin_opencontrail_config => config_hash,
|
||||
:plugin_nuage_config => config_hash,
|
||||
:plugin_ml2_config => config_hash
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures arbitrary neutron_plugin_nsx configurations' do
|
||||
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/baz').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary neutron_plugin_opencontrail configurations' do
|
||||
should contain_neutron_plugin_opencontrail('DEFAULT/foo').with_value('fooValue')
|
||||
should contain_neutron_plugin_opencontrail('DEFAULT/bar').with_value('barValue')
|
||||
|
@ -1,156 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'neutron::plugins::nsx' do
|
||||
let :pre_condition do
|
||||
"class { 'neutron':
|
||||
core_plugin => 'vmware_nsx.plugin.NsxV3Plugin' }
|
||||
class { 'neutron::keystone::authtoken':
|
||||
password => 'passw0rd',
|
||||
}
|
||||
class { 'neutron::server': }"
|
||||
end
|
||||
|
||||
let :default_params do
|
||||
{
|
||||
:default_overlay_tz => '<SERVICE DEFAULT>',
|
||||
:default_vlan_tz => '<SERVICE DEFAULT>',
|
||||
:default_bridge_cluster => '<SERVICE DEFAULT>',
|
||||
:default_tier0_router => '<SERVICE DEFAULT>',
|
||||
:nsx_api_managers => '<SERVICE DEFAULT>',
|
||||
:nsx_api_user => '<SERVICE DEFAULT>',
|
||||
:nsx_api_password => '<SERVICE DEFAULT>',
|
||||
:dhcp_profile => '<SERVICE DEFAULT>',
|
||||
:dhcp_relay_service => '<SERVICE DEFAULT>',
|
||||
:metadata_proxy => '<SERVICE DEFAULT>',
|
||||
:native_dhcp_metadata => '<SERVICE DEFAULT>',
|
||||
:package_ensure => 'present',
|
||||
:purge_config => false,
|
||||
}
|
||||
end
|
||||
|
||||
shared_examples 'neutron plugin nsx' do
|
||||
|
||||
context 'with defaults' do
|
||||
it { should contain_class('neutron::params') }
|
||||
|
||||
it 'should install the plugin package' do
|
||||
should contain_package('vmware-nsx').with(
|
||||
:ensure => 'present',
|
||||
:name => 'vmware-nsx',
|
||||
:tag => ['openstack', 'neutron-package']
|
||||
)
|
||||
end
|
||||
|
||||
it 'should have a nsx plugin ini file' do
|
||||
should contain_file('/etc/neutron/plugins/vmware/nsx.ini').with(
|
||||
:ensure => 'file',
|
||||
:owner => 'root',
|
||||
:group => 'neutron',
|
||||
:mode => '0640'
|
||||
)
|
||||
end
|
||||
|
||||
it 'should configure neutron.conf' do
|
||||
should contain_neutron_config('DEFAULT/core_plugin').with_value('vmware_nsx.plugin.NsxV3Plugin')
|
||||
end
|
||||
|
||||
it 'passes purge to resource' do
|
||||
should contain_resources('neutron_plugin_nsx').with({
|
||||
:purge => false
|
||||
})
|
||||
end
|
||||
|
||||
it 'should configure nsx.ini' do
|
||||
should contain_neutron_plugin_nsx('nsx_v3/default_overlay_tz').with_value(default_params[:default_overlay_tz])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/default_vlan_tz').with_value(default_params[:default_vlan_tz])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/default_bridge_cluster').with_value(default_params[:default_bridge_cluster])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/default_tier0_router').with_value(default_params[:default_tier0_router])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/nsx_api_managers').with_value(default_params[:nsx_api_managers])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/nsx_api_password').with_value(default_params[:nsx_api_password]).with_secret(true)
|
||||
should contain_neutron_plugin_nsx('nsx_v3/dhcp_profile').with_value(default_params[:dhcp_profile])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/dhcp_relay_service').with_value(default_params[:dhcp_relay_service])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/metadata_proxy').with_value(default_params[:metadata_proxy])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/native_dhcp_metadata').with_value(default_params[:native_dhcp_metadata])
|
||||
end
|
||||
end
|
||||
|
||||
context 'with parameters' do
|
||||
let (:params) do
|
||||
{
|
||||
:default_overlay_tz => 'fake-overlay-tz-uuid',
|
||||
:default_vlan_tz => 'fake-vlan-tz-uuid',
|
||||
:default_bridge_cluster => 'fake-bridge-cluster-uuid',
|
||||
:default_tier0_router => 'fake-tier0-uuid',
|
||||
:nsx_api_managers => '127.0.0.1',
|
||||
:nsx_api_user => 'admin',
|
||||
:nsx_api_password => 'pasword',
|
||||
:dhcp_profile => 'fake-dhcp-uuid',
|
||||
:dhcp_relay_service => 'fake-dhcp-relay-service',
|
||||
:metadata_proxy => 'fake-metadata-uuid',
|
||||
:native_dhcp_metadata => 'True',
|
||||
:purge_config => true,
|
||||
}
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_neutron_plugin_nsx('nsx_v3/default_overlay_tz').with_value(params[:default_overlay_tz])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/default_vlan_tz').with_value(params[:default_vlan_tz])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/default_bridge_cluster').with_value(params[:default_bridge_cluster])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/default_tier0_router').with_value(params[:default_tier0_router])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/nsx_api_managers').with_value(params[:nsx_api_managers])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/nsx_api_password').with_value(params[:nsx_api_password]).with_secret(true)
|
||||
should contain_neutron_plugin_nsx('nsx_v3/dhcp_profile').with_value(params[:dhcp_profile])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/dhcp_relay_service').with_value(params[:dhcp_relay_service])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/metadata_proxy').with_value(params[:metadata_proxy])
|
||||
should contain_neutron_plugin_nsx('nsx_v3/native_dhcp_metadata').with_value(params[:native_dhcp_metadata])
|
||||
should contain_resources('neutron_plugin_nsx').with({
|
||||
:purge => true
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'configure nsx with wrong core_plugin configure' do
|
||||
let :pre_condition do
|
||||
"class { 'neutron':
|
||||
core_plugin => 'foo' }"
|
||||
end
|
||||
|
||||
it { should raise_error(Puppet::Error, /NSX plugin should be the core_plugin in neutron.conf/) }
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'neutron plugin nsx 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/vmware/nsx.ini',
|
||||
)
|
||||
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 plugin nsx on RedHat' do
|
||||
it 'should create plugin symbolic link' do
|
||||
should contain_file('/etc/neutron/plugin.ini').with(
|
||||
:ensure => 'link',
|
||||
:target => '/etc/neutron/plugins/vmware/nsx.ini',
|
||||
:tag => 'neutron-config-file',
|
||||
)
|
||||
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 plugin nsx'
|
||||
it_behaves_like "neutron plugin nsx on #{facts[:osfamily]}"
|
||||
end
|
||||
end
|
||||
end
|
@ -1,43 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
provider_class = Puppet::Type.type(:neutron_plugin_nsx).provider(:ini_setting)
|
||||
describe provider_class do
|
||||
let(:resource ) do
|
||||
Puppet::Type::Neutron_plugin_nsx.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 plugin.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/vmware/nsx.ini')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
|
||||
resource = Puppet::Type::Neutron_plugin_nsx.new(
|
||||
{:name => 'somename/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_plugin_nsx.new(
|
||||
{:name => 'somename/foo', :value => 'foo', :ensure_absent_val => 'foo' }
|
||||
)
|
||||
provider = provider_class.new(resource)
|
||||
provider.exists?
|
||||
expect(resource[:ensure]).to eq :absent
|
||||
end
|
||||
end
|
||||
|
@ -1,20 +0,0 @@
|
||||
require 'puppet'
|
||||
require 'puppet/type/neutron_plugin_nsx'
|
||||
|
||||
describe 'Puppet::Type.type(:neutron_plugin_nsx)' do
|
||||
|
||||
before :each do
|
||||
@neutron_plugin_nsx = Puppet::Type.type(:neutron_plugin_nsx).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_nsx
|
||||
dependency = @neutron_plugin_nsx.autorequire
|
||||
expect(dependency.size).to eq(1)
|
||||
expect(dependency[0].target).to eq(@neutron_plugin_nsx)
|
||||
expect(dependency[0].source).to eq(anchor)
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user