File: ringbuilder.pp

package info (click to toggle)
puppet-module-swift 9.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,248 kB
  • ctags: 95
  • sloc: ruby: 5,804; python: 35; makefile: 17; sh: 15
file content (50 lines) | stat: -rw-r--r-- 1,555 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Used to configure nodes that are responsible for managing swift rings.
# Rings are used to make decicions about how to map objects in the cluster
#
# Specifies the following relationship:
#  Rings should be created before any devices are added to them
#  Rings should be rebalanced if anything changes
# == Parameters
#  [*part_power*] The total number of partitions that should exist in the ring.
#    This is expressed as a power of 2.
#  [*replicas*] Numer of replicas that should be maintained of each stored object.
#  [*min_part_hours*] Minimum amount of time before partitions can be moved.
#
# == Dependencies
#
#   Class['swift']
#
# == Examples
#
# == Authors
#
#   Dan Bode dan@puppetlabs.com
#
# == Copyright
#
# Copyright 2011 Puppetlabs Inc, unless otherwise noted.
#
class swift::ringbuilder(
  $part_power = undef,
  $replicas = undef,
  $min_part_hours = undef
) {

  include ::swift::deps
  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']: }

}