Adds support for RabbitMQ Clustering
Prior to this change, only a single RabbitMQ Broker could be deployed by the nova::rabbitmq class. This change implements the cluster_disk_nodes parameter that can enable RabbitMQ clustering. Defaults to false for backwards compatibility. Change-Id: Iac2d04e855adb53fbb9fe2a23f8773a692162744
This commit is contained in:
@@ -2,12 +2,19 @@
|
||||
# class for installing rabbitmq server for nova
|
||||
#
|
||||
#
|
||||
# ==Parameters
|
||||
#
|
||||
# [cluster_disk_nodes] Enables/disables RabbitMQ clustering. Specify an array of Rabbit Broker
|
||||
# IP addresses to configure clustering. Optional.
|
||||
# Defaults to false.
|
||||
#
|
||||
class nova::rabbitmq(
|
||||
$userid ='guest',
|
||||
$password ='guest',
|
||||
$port ='5672',
|
||||
$virtual_host ='/',
|
||||
$enabled = true
|
||||
$userid ='guest',
|
||||
$password ='guest',
|
||||
$port ='5672',
|
||||
$virtual_host ='/',
|
||||
$cluster_disk_nodes = false,
|
||||
$enabled = true
|
||||
) {
|
||||
|
||||
# only configure nova after the queue is up
|
||||
@@ -37,10 +44,21 @@ class nova::rabbitmq(
|
||||
$service_ensure = 'stopped'
|
||||
}
|
||||
|
||||
class { 'rabbitmq::server':
|
||||
service_ensure => $service_ensure,
|
||||
port => $port,
|
||||
delete_guest_user => $delete_guest_user,
|
||||
if $cluster_disk_nodes {
|
||||
class { 'rabbitmq::server':
|
||||
service_ensure => $service_ensure,
|
||||
port => $port,
|
||||
delete_guest_user => $delete_guest_user,
|
||||
config_cluster => true,
|
||||
cluster_disk_nodes => $cluster_disk_nodes,
|
||||
wipe_db_on_cookie_change => true,
|
||||
}
|
||||
} else {
|
||||
class { 'rabbitmq::server':
|
||||
service_ensure => $service_ensure,
|
||||
port => $port,
|
||||
delete_guest_user => $delete_guest_user,
|
||||
}
|
||||
}
|
||||
|
||||
if ($enabled) {
|
||||
|
@@ -75,5 +75,28 @@ describe 'nova::rabbitmq' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'with clustering' do
|
||||
|
||||
let :params do
|
||||
{
|
||||
:cluster_disk_nodes => ['rabbit01', 'rabbit02', 'rabbit03']
|
||||
}
|
||||
end
|
||||
|
||||
it 'should contain all the clustering resources' do
|
||||
|
||||
should contain_class('rabbitmq::server').with(
|
||||
:service_ensure => 'running',
|
||||
:port => '5672',
|
||||
:delete_guest_user => false,
|
||||
:config_cluster => true,
|
||||
:cluster_disk_nodes => ['rabbit01', 'rabbit02', 'rabbit03'],
|
||||
:wipe_db_on_cookie_change => true
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user