From 39f9169651d0e6f16e59d99e03293e5294312c80 Mon Sep 17 00:00:00 2001 From: zhangyangyang Date: Sat, 30 Sep 2017 17:43:37 +0800 Subject: [PATCH] Remove Class nova::rabbitmq nova::rabbitmq class is deprecated and will be removed in next release. Make other plans to configure rabbitmq resources. Change-Id: Ica69508f65c57295b3b2d6cecc22f74f7883913e --- manifests/rabbitmq.pp | 75 ------------------- ...class_nova::rabbitmq-3e04bc52ea21032d.yaml | 6 ++ spec/classes/nova_rabbitmq_spec.rb | 69 ----------------- 3 files changed, 6 insertions(+), 144 deletions(-) delete mode 100644 manifests/rabbitmq.pp create mode 100644 releasenotes/notes/remove_class_nova::rabbitmq-3e04bc52ea21032d.yaml delete mode 100644 spec/classes/nova_rabbitmq_spec.rb diff --git a/manifests/rabbitmq.pp b/manifests/rabbitmq.pp deleted file mode 100644 index 352cc40eb..000000000 --- a/manifests/rabbitmq.pp +++ /dev/null @@ -1,75 +0,0 @@ -# == Class: nova::rabbitmq -# -# Installs and manages rabbitmq server for nova -# -# == Parameters: -# -# [*userid*] -# (optional) The username to use when connecting to Rabbit -# Defaults to 'guest' -# -# [*password*] -# (optional) The password to use when connecting to Rabbit -# Defaults to 'guest' -# -# [*port*] -# (optional) Deprecated. The port to use when connecting to Rabbit -# This parameter keeps backward compatibility when we used to manage -# RabbitMQ service. -# Defaults to '5672' -# -# [*virtual_host*] -# (optional) The virtual host to use when connecting to Rabbit -# Defaults to '/' -# -# [*cluster_disk_nodes*] -# (optional) Enables/disables RabbitMQ clustering. Specify an array of Rabbit Broker -# IP addresses to configure clustering. -# Defaults to false -# -# [*enabled*] -# (optional) Deprecated. Whether to enable the Rabbit resources -# This parameter keeps backward compatibility when we used to manage -# RabbitMQ service. -# Defaults to true -# -class nova::rabbitmq( - $userid ='guest', - $password ='guest', - $virtual_host ='/', - # DEPRECATED PARAMETER - $cluster_disk_nodes = false, - $enabled = true, - $port ='5672', -) { - - warning('nova::rabbitmq class is deprecated and will be removed in next release. Make other plans to configure rabbitmq resources.') - - include ::nova::deps - - if ($enabled) { - if $userid == 'guest' { - $delete_guest_user = false - } else { - $delete_guest_user = true - rabbitmq_user { $userid: - admin => true, - password => $password, - provider => 'rabbitmqctl', - } - # I need to figure out the appropriate permissions - rabbitmq_user_permissions { "${userid}@${virtual_host}": - configure_permission => '.*', - write_permission => '.*', - read_permission => '.*', - provider => 'rabbitmqctl', - } - } - rabbitmq_vhost { $virtual_host: - provider => 'rabbitmqctl', - } - } - - # Only start Nova after the queue is up - Class['nova::rabbitmq'] -> Anchor['nova::service::end'] -} diff --git a/releasenotes/notes/remove_class_nova::rabbitmq-3e04bc52ea21032d.yaml b/releasenotes/notes/remove_class_nova::rabbitmq-3e04bc52ea21032d.yaml new file mode 100644 index 000000000..4bfd9c4bb --- /dev/null +++ b/releasenotes/notes/remove_class_nova::rabbitmq-3e04bc52ea21032d.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - Remove Class nova::rabbitmq + nova::rabbitmq class is deprecated and will be removed in next release. + Make other plans to configure rabbitmq resources. + \ No newline at end of file diff --git a/spec/classes/nova_rabbitmq_spec.rb b/spec/classes/nova_rabbitmq_spec.rb deleted file mode 100644 index 4dc7fd8d6..000000000 --- a/spec/classes/nova_rabbitmq_spec.rb +++ /dev/null @@ -1,69 +0,0 @@ -require 'spec_helper' - -describe 'nova::rabbitmq' do - - let :facts do - @default_facts.merge({ - :puppetversion => '2.7', - :osfamily => 'Debian' - }) - end - - describe 'with defaults' do - - it 'should contain all of the default resources' do - - is_expected.to contain_rabbitmq_vhost('/').with( - :provider => 'rabbitmqctl' - ) - end - - end - - describe 'when a rabbitmq user is specified' do - - let :params do - { - :userid => 'dan', - :password => 'pass' - } - end - - it 'should contain user and permissions' do - - is_expected.to contain_rabbitmq_user('dan').with( - :admin => true, - :password => 'pass', - :provider => 'rabbitmqctl' - ) - - is_expected.to contain_rabbitmq_user_permissions('dan@/').with( - :configure_permission => '.*', - :write_permission => '.*', - :read_permission => '.*', - :provider => 'rabbitmqctl' - ) - - end - - end - - describe 'when disabled' do - let :params do - { - :userid => 'dan', - :password => 'pass', - :enabled => false - } - end - - it 'should be disabled' do - - is_expected.to_not contain_rabbitmq_user('dan') - is_expected.to_not contain_rabbitmq_user_permissions('dan@/') - is_expected.to_not contain_rabbitmq_vhost('/') - - end - end - -end