puppet-swift/manifests/init.pp
Sebastien Badia 21f9eff35c Add client_package_ensure parameter and swift::client class
In the actual state of the manifest we can only setup package_ensure to
absent|present|latest. This commit allow end users to pin swift* and
swift-client to a specific version. (note that swift* and
python-swiftclient version are not the same).

A new class (swift::client) manage now client packages, and we keep the
retro-compatibility of commit 020b7723cb.

Change-Id: I9bcc5a0f9d0a93a812fb574c4571fb9584077e4a
2014-03-06 02:09:52 +01:00

78 lines
1.6 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.
#
# == 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',
$client_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,
}
}
class { 'swift::client':
ensure => $client_package_ensure;
}
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
}
}