diff --git a/lib/puppet/provider/neutron_plugin_nuage/ini_setting.rb b/lib/puppet/provider/neutron_plugin_nuage/ini_setting.rb deleted file mode 100644 index ec97bde96..000000000 --- a/lib/puppet/provider/neutron_plugin_nuage/ini_setting.rb +++ /dev/null @@ -1,16 +0,0 @@ -Puppet::Type.type(:neutron_plugin_nuage).provide( - :ini_setting, - :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting) -) do - - def self.file_path - '/etc/neutron/plugins/nuage/plugin.ini' - end - - # added for backwards compatibility with older versions of inifile - def file_path - self.class.file_path - end - -end - diff --git a/lib/puppet/type/neutron_plugin_nuage.rb b/lib/puppet/type/neutron_plugin_nuage.rb deleted file mode 100644 index f1d4f5805..000000000 --- a/lib/puppet/type/neutron_plugin_nuage.rb +++ /dev/null @@ -1,55 +0,0 @@ -Puppet::Type.newtype(:neutron_plugin_nuage) do - - ensurable - - newparam(:name, :namevar => true) do - desc 'Section/setting name to manage for nuage/plugin.ini (DEPRECATED)' - newvalues(/\S+\/\S+/) - end - - newproperty(:value) do - desc 'The value of the settings 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('') - end - - autorequire(:anchor) do - ['neutron::install::end'] - end - - autorequire(:file) do - '/etc/neutron/plugins/nuage/plugin.ini' - end - -end - diff --git a/manifests/config.pp b/manifests/config.pp index 129438a16..338bcdf7b 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -78,9 +78,6 @@ # [*plugin_opencontrail_config*] # (optional) Manage configuration of plugins/opencontrail/ContrailPlugin.ini # -# [*plugin_nuage_config*] -# (optional) Manage configuration of plugins/nuage/plugin.ini -# # [*plugin_ml2_config*] # (optional) Manage configuration of ml2_conf.ini # @@ -89,6 +86,9 @@ # [*linuxbridge_agent_config*] # (optional) Manage configuration of linuxbridge_agent.ini # +# [*plugin_nuage_config*] +# (optional) Manage configuration of plugins/nuage/plugin.ini +# # NOTE: The configuration MUST NOT be already handled by this module # or Puppet catalog compilation will fail with duplicate resources. # @@ -112,10 +112,10 @@ class neutron::config ( Hash $vpnaas_agent_config = {}, Hash $bgp_dragent_config = {}, Hash $plugin_opencontrail_config = {}, - Hash $plugin_nuage_config = {}, Hash $plugin_ml2_config = {}, # DEPRECATED PARAMETERS - Optional[Hash] $linuxbridge_agent_config = undef, + Optional[Hash] $linuxbridge_agent_config = undef, + Optional[Hash] $plugin_nuage_config = undef, ) { include neutron::deps @@ -127,6 +127,10 @@ class neutron::config ( $linuxbridge_agent_config_real = {} } + if $plugin_nuage_config != undef { + warning('The plugin_nuage_config parameter is deprecated and has no effect.') + } + create_resources('neutron_config', $server_config) create_resources('neutron_api_paste_ini', $api_paste_ini) create_resources('neutron_agent_ovs', $ovs_agent_config) @@ -147,6 +151,5 @@ class neutron::config ( create_resources('neutron_vpnaas_agent_config', $vpnaas_agent_config) create_resources('neutron_bgp_dragent_config', $bgp_dragent_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) } diff --git a/manifests/deps.pp b/manifests/deps.pp index e4638e1c4..2359e6569 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -50,7 +50,6 @@ class neutron::deps { Anchor['neutron::config::begin'] -> Neutron_bgp_dragent_config<||> -> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_l2gw_service_config<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_plugin_ml2<||> ~> Anchor['neutron::config::end'] - Anchor['neutron::config::begin'] -> Neutron_plugin_nuage<||> ~> Anchor['neutron::config::end'] Anchor['neutron::config::begin'] -> Neutron_plugin_opencontrail<||> ~> 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'] diff --git a/manifests/params.pp b/manifests/params.pp index ec8089569..404037aeb 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -12,7 +12,6 @@ class neutron::params { $macvtap_agent_service = 'neutron-macvtap-agent' $opencontrail_plugin_package = 'neutron-plugin-contrail' $opencontrail_config_file = '/etc/neutron/plugins/opencontrail/ContrailPlugin.ini' - $nuage_config_file = '/etc/neutron/plugins/nuage/plugin.ini' $dhcp_agent_service = 'neutron-dhcp-agent' $metering_agent_service = 'neutron-metering-agent' $l3_agent_service = 'neutron-l3-agent' diff --git a/manifests/plugins/ml2/nuage.pp b/manifests/plugins/ml2/nuage.pp deleted file mode 100644 index db696caed..000000000 --- a/manifests/plugins/ml2/nuage.pp +++ /dev/null @@ -1,117 +0,0 @@ -# -# DEPRECATED !! -# Configure the Nuage plugin for neutron. -# -# === Parameters -# -# [*nuage_net_partition_name*] -# (required) The net partition under which the VMs will be -# seen in the VSD -# -# [*nuage_vsd_ip*] -# (required) IP address of the Virtual Services Directory -# -# [*nuage_vsd_username*] -# (required) Username to be used to log into VSD -# -# [*nuage_vsd_password*] -# (required) Password to be used to log into VSD -# -# [*nuage_vsd_organization*] -# (required) Parameter required to log into VSD -# -# [*nuage_base_uri_version*] -# (required) URI version to be used based on the VSD release -# For example v3_0 -# -# [*nuage_cms_id*] -# (required) CMS ID generated by the VSD -# -# [*nuage_auth_resource*] -# (optional) The auth resource value to be use to connect -# to VSD. The default is /me -# -# [*nuage_server_ssl*] -# (optional) Flag to determine whether to use ssl connection -# to connect to VSD. The default is True -# -# [*purge_config*] -# (optional) Whether to set only the specified config options -# in the nuage config. -# Defaults to false. -# -# [*nuage_default_allow_non_ip*] -# (optional) Whether to allow non-IP traffic. -# Defaults to false. -# -class neutron::plugins::ml2::nuage ( - $nuage_net_partition_name, - $nuage_vsd_ip, - $nuage_vsd_username, - $nuage_vsd_password, - $nuage_vsd_organization, - $nuage_base_uri_version, - $nuage_cms_id, - $nuage_auth_resource = '/me', - $nuage_server_ssl = true, - Boolean $purge_config = false, - $nuage_default_allow_non_ip = false, -) { - - include neutron::deps - include neutron::params - - warning('Support for ml2 Nuage plugin has been deprecated.') - - file { '/etc/neutron/plugins/nuage': - ensure => directory, - tag => 'neutron-config-file', - } - - case $facts['os']['family'] { - 'Debian': { - file_line { 'neutron-server-DAEMON_ARGS': - path => '/etc/default/neutron-server', - line => 'DAEMON_ARGS="$DAEMON_ARGS --config-file /etc/neutron/plugins/nuage/plugin.ini"', - tag => 'neutron-file-line' - } - } - 'Redhat': { - file { '/etc/neutron/conf.d/neutron-server/nuage_plugin.conf': - ensure => link, - require => File['/etc/neutron/plugins/nuage/plugin.ini'], - target => $::neutron::params::nuage_config_file, - tag => 'neutron-config-file', - } - } - default : { - fail("Unsupported osfamily: ${facts['os']['family']}") - } - } - - file { '/etc/neutron/plugins/nuage/plugin.ini': - ensure => file, - owner => 'root', - group => $::neutron::params::group, - require => File['/etc/neutron/plugins/nuage'], - mode => '0640', - tag => 'neutron-config-file', - } - - resources { 'neutron_plugin_nuage': - purge => $purge_config, - } - - $nuage_base_uri_base = '/nuage/api' - neutron_plugin_nuage { - 'RESTPROXY/default_net_partition_name': value => $nuage_net_partition_name; - 'RESTPROXY/server': value => $nuage_vsd_ip; - 'RESTPROXY/serverauth': value => "${nuage_vsd_username}:${nuage_vsd_password}", secret => true; - 'RESTPROXY/organization': value => $nuage_vsd_organization; - 'RESTPROXY/auth_resource': value => $nuage_auth_resource; - 'RESTPROXY/serverssl': value => $nuage_server_ssl; - 'RESTPROXY/base_uri': value => "${nuage_base_uri_base}/${nuage_base_uri_version}"; - 'RESTPROXY/cms_id': value => $nuage_cms_id; - 'PLUGIN/default_allow_non_ip': value => $nuage_default_allow_non_ip; - } -} diff --git a/releasenotes/notes/remove-nuage-c52934cae4165ea1.yaml b/releasenotes/notes/remove-nuage-c52934cae4165ea1.yaml new file mode 100644 index 000000000..b3c3178b4 --- /dev/null +++ b/releasenotes/notes/remove-nuage-c52934cae4165ea1.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + Support for the nuage ml2 plugin has been removed. + +deprecations: + - | + The ``neutron::config::plugin_nuage_config`` parameter has been deprecated + and has no effect now. diff --git a/spec/classes/neutron_config_spec.rb b/spec/classes/neutron_config_spec.rb index 3ea9d8ced..53112e92e 100644 --- a/spec/classes/neutron_config_spec.rb +++ b/spec/classes/neutron_config_spec.rb @@ -149,7 +149,6 @@ describe 'neutron::config' do let :params do { :plugin_opencontrail_config => config_hash, - :plugin_nuage_config => config_hash, :plugin_ml2_config => config_hash } end @@ -160,12 +159,6 @@ describe 'neutron::config' do should contain_neutron_plugin_opencontrail('DEFAULT/baz').with_ensure('absent') end - it 'configures arbitrary neutron_plugin_nuage configurations' do - should contain_neutron_plugin_nuage('DEFAULT/foo').with_value('fooValue') - should contain_neutron_plugin_nuage('DEFAULT/bar').with_value('barValue') - should contain_neutron_plugin_nuage('DEFAULT/baz').with_ensure('absent') - end - it 'configures arbitrary neutron_plugin_ml2 configurations' do should contain_neutron_plugin_ml2('DEFAULT/foo').with_value('fooValue') should contain_neutron_plugin_ml2('DEFAULT/bar').with_value('barValue') diff --git a/spec/classes/neutron_plugins_ml2_nuage_spec.rb b/spec/classes/neutron_plugins_ml2_nuage_spec.rb deleted file mode 100644 index 2fc5900c0..000000000 --- a/spec/classes/neutron_plugins_ml2_nuage_spec.rb +++ /dev/null @@ -1,106 +0,0 @@ -require 'spec_helper' - -describe 'neutron::plugins::ml2::nuage' do - let :pre_condition do - "class { 'neutron': - core_plugin => 'ml2' } - class { 'neutron::keystone::authtoken': - password => 'passw0rd', - } - class { 'neutron::server': } - class { 'neutron::plugins::ml2': - mechanism_drivers => ['nuage'] }" - end - - let :params do - { - :nuage_vsd_ip => %w(192.168.33.3), - :nuage_vsd_username => 'test', - :nuage_vsd_password => 'test', - :nuage_vsd_organization => 'vsd', - :nuage_net_partition_name => 'test', - :nuage_base_uri_version => 'v3.0', - :nuage_cms_id => '7488fae2-7e51-11e5-8bcf-feff819cdc9f', - :purge_config => false, - :nuage_default_allow_non_ip => false,} - end - - shared_examples 'neutron plugin ml2 nuage' do - - it { should contain_class('neutron::params') } - - it 'configures neutron.conf' do - should contain_neutron_config('DEFAULT/core_plugin').with_value('ml2') - end - - it 'passes purge to resource' do - should contain_resources('neutron_plugin_nuage').with({ - :purge => false - }) - end - - it 'should have a nuage plugin ini file' do - should contain_file('/etc/neutron/plugins/nuage/plugin.ini').with( - :ensure => 'file', - :owner => 'root', - :group => 'neutron', - :mode => '0640' - ) - end - - it 'should configure plugin.ini' do - should contain_neutron_plugin_nuage('RESTPROXY/default_net_partition_name').with_value(params[:nuage_net_partition_name]) - should contain_neutron_plugin_nuage('RESTPROXY/server').with_value(params[:nuage_vsd_ip]) - should contain_neutron_plugin_nuage('RESTPROXY/serverauth')\ - .with_value("#{params[:nuage_vsd_username]}:#{params[:nuage_vsd_password]}")\ - .with_secret(true) - should contain_neutron_plugin_nuage('RESTPROXY/organization').with_value(params[:nuage_vsd_organization]) - should contain_neutron_plugin_nuage('RESTPROXY/cms_id').with_value(params[:nuage_cms_id]) - should contain_neutron_plugin_nuage('PLUGIN/default_allow_non_ip').with_value(params[:nuage_default_allow_non_ip]) - end - - context 'when allowing Non-IP' do - before :each do - params.merge!(:nuage_default_allow_non_ip => true) - end - it 'default_allow_non_ip is set to true' do - should contain_neutron_plugin_nuage('PLUGIN/default_allow_non_ip').with_value(true) - end - end - end - - shared_examples 'neutron plugin ml2 nuage on Debian' do - it 'configures /etc/default/neutron-server' do - should contain_file_line('neutron-server-DAEMON_ARGS').with( - :path => '/etc/default/neutron-server', - :line => 'DAEMON_ARGS="$DAEMON_ARGS --config-file /etc/neutron/plugins/nuage/plugin.ini"', - :tag => 'neutron-file-line', - ) - should contain_file_line('neutron-server-DAEMON_ARGS').that_requires('Anchor[neutron::config::begin]') - should contain_file_line('neutron-server-DAEMON_ARGS').that_notifies('Anchor[neutron::config::end]') - end - end - - shared_examples 'neutron plugin ml2 nuage on RedHat' do - it 'should create plugin symbolic link' do - should contain_file('/etc/neutron/conf.d/neutron-server/nuage_plugin.conf').with( - :ensure => 'link', - :target => '/etc/neutron/plugins/nuage/plugin.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 ml2 nuage' - it_behaves_like "neutron plugin ml2 nuage on #{facts[:os]['family']}" - end - end -end diff --git a/spec/unit/provider/neutron_plugin_nuage/ini_setting_spec.rb b/spec/unit/provider/neutron_plugin_nuage/ini_setting_spec.rb deleted file mode 100644 index a61ef1ecd..000000000 --- a/spec/unit/provider/neutron_plugin_nuage/ini_setting_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require 'spec_helper' - -provider_class = Puppet::Type.type(:neutron_plugin_nuage).provider(:ini_setting) -describe provider_class do - let(:resource ) do - Puppet::Type::Neutron_plugin_nuage.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 - expect(provider.section).to eq('DEFAULT') - expect(provider.setting).to eq('foo') - expect(provider.file_path).to eq('/etc/neutron/plugins/nuage/plugin.ini') - end - end - end - - it 'should ensure absent when is specified as a value' do - resource = Puppet::Type::Neutron_plugin_nuage.new( - {:name => 'somename/foo', :value => ''} - ) - 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_nuage.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 -