swift/ringbuilder: allow to disable the ring building

When using Hiera, it's usefull to have the "enabled" parameter to either
enable or disable the ring building, since it should be run on one
single node.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2014-06-11 13:54:30 +02:00
parent a1d6853552
commit ff448f8733
2 changed files with 32 additions and 17 deletions

View File

@ -16,6 +16,7 @@
# Swift ring builder node
#
class cloud::object::ringbuilder(
$enabled = false,
$rsyncd_ipaddress = '127.0.0.1',
$replicas = 3,
$swift_rsync_max_connections = 5,
@ -23,6 +24,7 @@ class cloud::object::ringbuilder(
include cloud::object
if $enabled {
Ring_object_device <<| |>>
Ring_container_device <<| |>>
Ring_account_device <<| |>>
@ -44,3 +46,5 @@ class cloud::object::ringbuilder(
}
}
}

View File

@ -9,6 +9,7 @@ describe 'cloud::object::ringbuilder' do
:rsyncd_ipaddress => '127.0.0.1',
:replicas => 3,
:swift_rsync_max_connections => 5,
:enabled => true
}
end
@ -27,6 +28,16 @@ describe 'cloud::object::ringbuilder' do
})
end
context 'when ringbuilder is not enabled' do
before do
params.merge!(
:enabled => false
)
end
it 'should not configure swift ring builder' do
should_not contain_class('swift::ringbuilder')
end
end
end
context 'on Debian platforms' do