Puppet Class: cubbystack::swift::container
- Defined in:
- manifests/swift/container.pp
Overview
Class: cubbystack::swift::container
Configures the swift-container package and container-server.conf
Parameters
- settings
-
A hash of key => value settings to go in container-server.conf
- package_ensure
-
The status of the swift-container package Defaults to latest
- service_enable
-
The status of the swift-container service. Defaults to true
- config_file
-
The path to container-server.conf Defaults to /etc/swift/container-server.conf
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 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 |
# File 'manifests/swift/container.pp', line 22
class cubbystack::swift::container (
$settings,
$package_ensure = latest,
$service_enable = true,
$config_file = '/etc/swift/container-server.conf',
) {
include ::cubbystack::params
## Meta settings and globals
$tags = ['openstack', 'swift', 'swift-container']
# Restart container-server if the configuration changes
Cubbystack_config<| tag == 'swift-container' |> ~> Service<| tag == 'swift-container' |>
# container settings
$settings.each |$setting, $value| {
cubbystack_config { "${config_file}: ${setting}":
value => $value,
tag => $tags,
}
}
# Package and service config
if ($service_enable) {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
# Install the container server package and manage its service
cubbystack::functions::generic_swift_service { 'container':
service_enable => $service_enable,
package_ensure => $package_ensure,
tags => $tags,
}
# Manage the supplemental auditor service
service { 'swift-container-auditor':
name => $::cubbystack::params::swift_container_auditor_service_name,
enable => $service_enable,
ensure => $service_ensure,
tag => $tags,
}
# Manage the supplemental updater service
service { 'swift-container-updater':
name => $::cubbystack::params::swift_container_updater_service_name,
enable => $service_enable,
ensure => $service_ensure,
tag => $tags,
}
}
|