messaging: fix rabbitmq clustering (closes: #4655)

This commit is contained in:
Sebastien Badia
2014-01-09 22:10:31 +01:00
parent 3b18563723
commit 05814d1e87
2 changed files with 9 additions and 5 deletions

View File

@@ -30,13 +30,14 @@
class privatecloud::messaging( class privatecloud::messaging(
$rabbit_hosts = $os_params::rabbit_hosts, $rabbit_hosts = $os_params::rabbit_hosts,
$rabbit_names = $os_params::rabbit_names,
$rabbit_password = $os_params::rabbit_password $rabbit_password = $os_params::rabbit_password
){ ){
class { 'rabbitmq::server': class { 'rabbitmq::server':
delete_guest_user => true, delete_guest_user => true,
config_cluster => true, config_cluster => true,
cluster_disk_nodes => $rabbit_hosts, cluster_disk_nodes => $rabbit_names,
wipe_db_on_cookie_change => true, wipe_db_on_cookie_change => true,
} }

View File

@@ -23,15 +23,18 @@ describe 'privatecloud::messaging' do
shared_examples_for 'openstack messaging' do shared_examples_for 'openstack messaging' do
let :params do let :params do
{ :rabbit_hosts => ['10.0.0.1'], {
:rabbit_password => 'secrete' } :rabbit_names => ['foo','boo','zoo'],
:rabbit_hosts => ['10.0.0.1','10.0.0.2','10.0.0.3'],
:rabbit_password => 'secrete'
}
end end
it 'configure rabbitmq-server' do it 'configure rabbitmq-server' do
should contain_class('rabbitmq::server').with( should contain_class('rabbitmq::server').with(
:delete_guest_user => true, :delete_guest_user => true,
:config_cluster => true, :config_cluster => true,
:cluster_disk_nodes => ['10.0.0.1'], :cluster_disk_nodes => params[:rabbit_names],
:wipe_db_on_cookie_change => true :wipe_db_on_cookie_change => true
) )
end end