2012-01-19 18:58:37 -08:00
|
|
|
# Install and configure base swift components
|
2012-02-13 15:39:18 -08:00
|
|
|
#
|
2012-01-19 18:58:37 -08:00
|
|
|
# == Parameters
|
|
|
|
# [*swift_hash_suffix*] string of text to be used
|
|
|
|
# as a salt when hashing to determine mappings in the ring.
|
2012-02-13 15:39:18 -08:00
|
|
|
# This file should be the same on every node in the cluster.
|
2012-02-14 15:05:35 -08:00
|
|
|
# [*package_ensure*] The ensure state for the swift package.
|
|
|
|
# Optional. Defaults to present.
|
2012-01-19 18:58:37 -08:00
|
|
|
#
|
2012-02-13 15:39:18 -08:00
|
|
|
# == Dependencies
|
|
|
|
#
|
|
|
|
# Class['ssh::server::install']
|
|
|
|
#
|
|
|
|
# == Authors
|
|
|
|
#
|
|
|
|
# Dan Bode dan@puppetlabs.com
|
|
|
|
#
|
|
|
|
# == Copyright
|
|
|
|
#
|
|
|
|
# Copyright 2011 Puppetlabs Inc, unless otherwise noted.
|
2012-01-19 18:58:37 -08:00
|
|
|
#
|
|
|
|
class swift(
|
|
|
|
$swift_hash_suffix,
|
|
|
|
$package_ensure = 'present'
|
|
|
|
) {
|
|
|
|
|
2012-03-20 09:30:58 -07:00
|
|
|
include swift::params
|
2013-05-27 15:56:11 +08:00
|
|
|
include ssh::server::install
|
2012-03-20 09:30:58 -07:00
|
|
|
|
2012-01-19 18:58:37 -08:00
|
|
|
Class['ssh::server::install'] -> Class['swift']
|
|
|
|
|
2012-11-02 17:53:56 +04:00
|
|
|
if !defined(Package['swift']) {
|
|
|
|
package { 'swift':
|
|
|
|
ensure => $package_ensure,
|
2013-08-25 23:29:34 -04:00
|
|
|
name => $::swift::params::package_name,
|
2012-11-02 17:53:56 +04:00
|
|
|
}
|
2012-01-19 18:58:37 -08:00
|
|
|
}
|
|
|
|
|
2012-10-28 18:12:04 -06:00
|
|
|
package { 'swiftclient':
|
|
|
|
ensure => $package_ensure,
|
2013-08-25 23:29:34 -04:00
|
|
|
name => $::swift::params::client_package,
|
2012-10-28 18:12:04 -06:00
|
|
|
}
|
|
|
|
|
2012-01-19 18:58:37 -08:00
|
|
|
File { owner => 'swift', group => 'swift', require => Package['swift'] }
|
|
|
|
|
|
|
|
file { '/home/swift':
|
|
|
|
ensure => directory,
|
2013-07-01 18:27:13 -04:00
|
|
|
mode => '0700',
|
2012-01-19 18:58:37 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/swift':
|
|
|
|
ensure => directory,
|
2013-07-01 18:27:13 -04:00
|
|
|
mode => '2770',
|
2012-01-19 18:58:37 -08:00
|
|
|
}
|
2012-11-19 18:47:03 +04:00
|
|
|
user {'swift':
|
|
|
|
ensure => present,
|
|
|
|
}
|
|
|
|
file { '/var/lib/swift':
|
|
|
|
ensure => directory,
|
2013-07-01 18:27:13 -04:00
|
|
|
owner => 'swift'
|
2012-11-19 18:47:03 +04:00
|
|
|
}
|
2012-01-19 18:58:37 -08:00
|
|
|
file { '/var/run/swift':
|
|
|
|
ensure => directory,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/swift/swift.conf':
|
|
|
|
ensure => present,
|
2013-07-01 18:27:13 -04:00
|
|
|
mode => '0660',
|
2012-01-19 18:58:37 -08:00
|
|
|
}
|
2012-10-02 11:13:45 +02:00
|
|
|
|
2013-08-26 08:34:45 -04:00
|
|
|
swift_config { 'swift-hash/swift_hash_path_suffix':
|
|
|
|
value => $swift_hash_suffix
|
|
|
|
}
|
2012-01-19 18:58:37 -08:00
|
|
|
}
|