Merge pull request #508 from enovance/ringbuilder-enable

swift/ringbuilder: allow to disable the ring building
This commit is contained in:
Yanis Guenane 2014-06-11 08:10:53 -04:00
commit b59e771009
2 changed files with 32 additions and 17 deletions

View File

@ -16,6 +16,7 @@
# Swift ring builder node # Swift ring builder node
# #
class cloud::object::ringbuilder( class cloud::object::ringbuilder(
$enabled = false,
$rsyncd_ipaddress = '127.0.0.1', $rsyncd_ipaddress = '127.0.0.1',
$replicas = 3, $replicas = 3,
$swift_rsync_max_connections = 5, $swift_rsync_max_connections = 5,
@ -23,24 +24,27 @@ class cloud::object::ringbuilder(
include cloud::object include cloud::object
Ring_object_device <<| |>> if $enabled {
Ring_container_device <<| |>> Ring_object_device <<| |>>
Ring_account_device <<| |>> Ring_container_device <<| |>>
Ring_account_device <<| |>>
class {'swift::ringbuilder' : class {'swift::ringbuilder' :
part_power => 15, part_power => 15,
replicas => $replicas, replicas => $replicas,
min_part_hours => 24, min_part_hours => 24,
}
class {'swift::ringserver' :
local_net_ip => $rsyncd_ipaddress,
max_connections => $swift_rsync_max_connections,
}
# exports rsync gets that can be used to sync the ring files
@@swift::ringsync { ['account', 'object', 'container']:
ring_server => $rsyncd_ipaddress,
}
} }
class {'swift::ringserver' :
local_net_ip => $rsyncd_ipaddress,
max_connections => $swift_rsync_max_connections,
}
# exports rsync gets that can be used to sync the ring files
@@swift::ringsync { ['account', 'object', 'container']:
ring_server => $rsyncd_ipaddress,
}
} }

View File

@ -6,9 +6,10 @@ describe 'cloud::object::ringbuilder' do
let :params do let :params do
{ {
:rsyncd_ipaddress => '127.0.0.1', :rsyncd_ipaddress => '127.0.0.1',
:replicas => 3, :replicas => 3,
:swift_rsync_max_connections => 5, :swift_rsync_max_connections => 5,
:enabled => true
} }
end end
@ -27,6 +28,16 @@ describe 'cloud::object::ringbuilder' do
}) })
end 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 end
context 'on Debian platforms' do context 'on Debian platforms' do