Files
puppet-swift/manifests/init.pp
Emilien Macchi c0a1195f53 Improve File resources idempotency
* use selinux_ignore_defaults parameter for directory to avoid this kind
  of issue:
(...) seltype: seltype changed 'swift_var_run_t' to 'var_run_t'

* Do not manage ownership for /etc/swift/*-server to avoid this kind of
  issue:
(...) owner changed 'root' to 'swift'

* Do not manage /etc/init.d/swift-container-sync file, already managed
  by packaging:
~ dpkg -S /etc/init.d/swift-container-sync
swift-container: /etc/init.d/swift-container-sync

Change-Id: I1d742d118943fb0b11c47fd322052f50156e2994
2015-09-29 18:40:49 +00:00

81 lines
1.8 KiB
Puppet

# Install and configure base swift components
#
# == Parameters
#
# [*swift_hash_suffix*] string of text to be used
# 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*] The ensure state for the swift package.
# (Optional) Defaults to present.
#
# [*client_package_ensure*] The ensure state for the swift client package.
# (Optional) Defaults to present.
#
# [*max_header_size*] Max HTTP header size for incoming requests for all swift
# services. Recommended size is 32768 for PKI keystone tokens.
# (Optional) Defaults to 8192
#
# == Dependencies
#
# None
#
# == Authors
#
# Dan Bode dan@puppetlabs.com
#
# == Copyright
#
# Copyright 2011 Puppetlabs Inc, unless otherwise noted.
#
class swift(
$swift_hash_suffix,
$package_ensure = 'present',
$client_package_ensure = 'present',
$max_header_size = '8192',
) {
include ::swift::params
if !defined(Package['swift']) {
package { 'swift':
ensure => $package_ensure,
name => $::swift::params::package_name,
tag => ['openstack', 'swift-package'],
}
}
class { '::swift::client':
ensure => $client_package_ensure;
}
File { owner => 'swift', group => 'swift', require => Package['swift'] }
file { '/etc/swift':
ensure => directory,
}
user {'swift':
ensure => present,
}
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_suffix,
}
swift_config { 'swift-constraints/max_header_size':
value => $max_header_size,
}
}