puppet-swift/manifests/ringbuilder/rebalance.pp
Dan Prince b8b443416d Add seed parameter to ringbuilder::rebalance.
This patch adds an optional seed parameter to the
swift::ringbuilder::rebalance definition. The seed
parameter can be useful if you want to (manually)
generate rings on independant servers and ensure that
the partition assignments are the same.

Change-Id: I840b8fe0125ed25e84f7681fada1b1102e48f32b
2015-01-08 17:36:24 -05:00

26 lines
710 B
Puppet

# Swift::Ring::Rebalance
# Reblances the specified ring. Assumes that the ring already exists
# and is stored at /etc/swift/${name}.builder
#
# == Parameters
#
# [*name*] Type of ring to rebalance. The ring file is assumed to be at the path
# /etc/swift/${name}.builder
#
# [*seed*] Optional. Seed value used to seed pythons pseudo-random for ringbuilding.
define swift::ringbuilder::rebalance(
$seed = undef
) {
validate_re($name, '^object|container|account$')
if $seed {
validate_re($seed, '^\d+$')
}
exec { "rebalance_${name}":
command => strip("swift-ring-builder /etc/swift/${name}.builder rebalance ${seed}"),
path => ['/usr/bin'],
refreshonly => true,
}
}