Puppet Class: swift

Inherited by:
swift::proxy::ceilometer
Defined in:
manifests/init.pp

Overview

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 ouside 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 ouside 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.

max_header_size

(Optional) Max HTTP header size for incoming requests for all swift services. Recommended size is 32768 for PKI keystone tokens. Defaults to 8192

Dependencies

None

Authors

Dan Bode dan@puppetlabs.com

Copyright 2011 Puppetlabs Inc, unless otherwise noted.

Parameters:

  • swift_hash_path_suffix (Any) (defaults to: undef)
  • swift_hash_path_prefix (Any) (defaults to: undef)
  • package_ensure (Any) (defaults to: 'present')
  • max_header_size (Any) (defaults to: '8192')


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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'manifests/init.pp', line 47

class swift(
  $swift_hash_path_suffix = undef,
  $swift_hash_path_prefix = undef,
  $package_ensure         = 'present',
  $max_header_size        = '8192',
) {

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

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

  if !defined(Package['swift']) {
    package { 'swift':
      ensure => $package_ensure,
      name   => $::swift::params::package_name,
      tag    => ['openstack', 'swift-package'],
    }
  }

  File {
    owner => $::swift::params::user,
    group => $::swift::params::group,
    tag   => 'swift-file',
  }

  file { '/etc/swift':
    ensure => directory,
  }
  user {'swift':
    ensure  => present,
    require => Anchor['swift::install::end'],
  }
  file { '/var/lib/swift':
    ensure => directory,
  }
  file { '/var/run/swift':
    ensure                  => directory,
    selinux_ignore_defaults => true,
  }

  file { '/etc/swift/swift.conf':
    ensure => file,
  }

  File['/etc/swift/swift.conf'] -> Swift_config<||>

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