puppet-swift/manifests/init.pp
David Moreau Simard 449fd78f48 Remove redundant user ownership declaration and ensure spec test coherency
swift is already set as a owner for File[] resources. This is a
simple cleanup that removes a redundant user declaration. The spec
tests did not verify that default File[] values were applied to
/var/lib/swift.

Change-Id: I608ef39ca8bbf78ca8029a65979db659184baa3f
2014-01-09 11:48:04 -05:00

74 lines
1.5 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.
#
# == Dependencies
#
# Class['ssh::server::install']
#
# == Authors
#
# Dan Bode dan@puppetlabs.com
#
# == Copyright
#
# Copyright 2011 Puppetlabs Inc, unless otherwise noted.
#
class swift(
$swift_hash_suffix,
$package_ensure = 'present'
) {
include swift::params
include ssh::server::install
Class['ssh::server::install'] -> Class['swift']
if !defined(Package['swift']) {
package { 'swift':
ensure => $package_ensure,
name => $::swift::params::package_name,
}
}
package { 'swiftclient':
ensure => $package_ensure,
name => $::swift::params::client_package,
}
File { owner => 'swift', group => 'swift', require => Package['swift'] }
file { '/home/swift':
ensure => directory,
mode => '0700',
}
file { '/etc/swift':
ensure => directory,
mode => '2770',
}
user {'swift':
ensure => present,
}
file { '/var/lib/swift':
ensure => directory,
}
file { '/var/run/swift':
ensure => directory,
}
file { '/etc/swift/swift.conf':
ensure => present,
mode => '0660',
}
swift_config { 'swift-hash/swift_hash_path_suffix':
value => $swift_hash_suffix
}
}