Merge "Remove Class nova::rabbitmq"
This commit is contained in:
@@ -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']
|
|
||||||
}
|
|
@@ -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.
|
||||||
|
|
@@ -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
|
|
Reference in New Issue
Block a user