File: init.pp

package info (click to toggle)
puppet-module-swift 21.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,084 kB
  • sloc: ruby: 9,261; python: 38; sh: 10; makefile: 10
file content (80 lines) | stat: -rw-r--r-- 2,736 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Install and configure base swift components
#
# == Parameters
#
# [*swift_hash_path_suffix*]
#   (Required) String. A suffix used by hash_path to offer a bit more security
#   when generating hashes for paths. It simply appends this value to all
#   paths; if someone knows this suffix, it's easier for them to guess the hash
#   a path will end up with. New installations are advised to set this
#   parameter to a random secret, which would not be disclosed outside the
#   organization. The same secret needs to be used by all swift servers of the
#   same cluster. Existing installations should set this parameter to an empty
#   string.
#
# [*swift_hash_path_prefix*]
#   (Required) String. A prefix used by hash_path to offer a bit more security
#   when generating hashes for paths. It simply prepends this value to all paths;
#   if someone knows this prefix, it's easier for them to guess the hash a path
#   will end up with. New installations are advised to set this parameter to a
#   random secret, which would not be disclosed outside the organization. The
#   same secret needs to be used by all swift servers of the same cluster.
#   Existing installations should set this parameter to an empty string.
#   as a salt when hashing to determine mappings in the ring.
#   This file should be the same on every node in the cluster.
#
# [*package_ensure*]
#   (Optional) The ensure state for the swift package.
#   Defaults to present.
#
# DEPRECATED PARAMETERS
#
# [*max_header_size*]
#   (Optional) Max HTTP header size for incoming requests for all swift
#   services.
#   Defaults to undef
#
# == Dependencies
#
# None
#
# == Authors
#
#   Dan Bode dan@puppetlabs.com
#
# == Copyright
#
# Copyright 2011 Puppetlabs Inc, unless otherwise noted.
#
class swift(
  $swift_hash_path_suffix = $::os_service_default,
  $swift_hash_path_prefix = $::os_service_default,
  $package_ensure         = 'present',
  # DEPRECATED PARAMETERS
  $max_header_size        = undef
) {

  include swift::deps
  include swift::params
  include swift::client

  if is_service_default($swift_hash_path_prefix) and is_service_default($swift_hash_path_suffix) {
    fail('You must specify at least swift_hash_path_prefix or swift_hash_path_suffix')
  }

  package { 'swift':
    ensure => $package_ensure,
    name   => $::swift::params::package_name,
    tag    => ['openstack', 'swift-package'],
  }

  swift_config {
    'swift-hash/swift_hash_path_suffix': value => $swift_hash_path_suffix;
    'swift-hash/swift_hash_path_prefix': value => $swift_hash_path_prefix;
  }

  if $max_header_size != undef {
    warning('The swift::max_header_size parameter is deprecated. Use the swift::constraints class.')
    include swift::constraints
  }
}