917426380e
This commit adds a class, defined resources and native types that can be used together to manage the creation, configuration, and rebalancing of rings. Creates the following native types: ring_account_device ring_container_device ring_object_device The implementation of these types is provided by swift-ring-builder and most of the functionality is provided by the parent provider (SwiftRingBuilder) Each of the providers is hard-coded to find the relevent ring database in /etc/swift. This directory location can currently not be configured. Each provider implements self.instances so the current state can of the ring can be queried from puppet. These providers do not handle either the creation or the rebalancing of the rings, they are intended to be used in combination with defined resource types that perform that functionality: swift::ringbuilder::create swift::ringbuilder::rebalance The swift::ringbuilder class is also created as a part of this commit. This class does the following: - creates object, account, and container rings (it uses the same parameters to create these rings) - creates the rebalance defines - sets up the following relationships: for each ring type, create should be applied before the native types which should refresh the rebalance
27 lines
772 B
Puppet
27 lines
772 B
Puppet
#
|
|
# role for deploying
|
|
#
|
|
class swift::ringbuilder(
|
|
$part_power = undef,
|
|
$replicas = undef,
|
|
$min_part_hours = undef
|
|
) {
|
|
|
|
Class['swift'] -> Class['swift::ringbuilder']
|
|
|
|
swift::ringbuilder::create{ ['object', 'account', 'container']:
|
|
part_power => $part_power,
|
|
replicas => $replicas,
|
|
min_part_hours => $min_part_hours,
|
|
}
|
|
|
|
Swift::Ringbuilder::Create['object'] -> Ring_object_device <| |> ~> Swift::Ringbuilder::Rebalance['object']
|
|
|
|
Swift::Ringbuilder::Create['container'] -> Ring_container_device <| |> ~> Swift::Ringbuilder::Rebalance['container']
|
|
|
|
Swift::Ringbuilder::Create['account'] -> Ring_account_device <| |> ~> Swift::Ringbuilder::Rebalance['account']
|
|
|
|
swift::ringbuilder::rebalance{ ['object', 'account', 'container']: }
|
|
|
|
}
|