Puppet Class: cubbystack::cinder
- Defined in:
- manifests/cinder.pp
Overview
Class: cubbystack::cinder
Configures the cinder-common package and cinder.conf
Parameters
- settings
-
A hash of key => value settings to go in cinder.conf
- config_file
-
The path to cinder.conf Defaults to /etc/cinder/cinder.conf
- package_ensure
-
The status of the cinder-common package Defaults to latest
18 19 20 21 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 |
# File 'manifests/cinder.pp', line 18
class cubbystack::cinder (
$settings,
$package_ensure = latest,
$config_file = '/etc/cinder/cinder.conf',
) {
include ::cubbystack::params
## Meta settings and globals
$tags = ['openstack', 'cinder']
# Make sure cinder is installed before configuration begins
Package<| tag == 'cinder' |> -> Cubbystack_config<| tag == 'cinder' |>
Cubbystack_config<| tag == 'cinder' |> -> Service<| tag == 'cinder' |>
# Restart cinder services whenever cinder.conf has been changed
Cubbystack_config<| tag == 'cinder' |> ~> Service<| tag == 'cinder' |>
# Global file attributes
File {
ensure => present,
owner => 'cinder',
group => 'cinder',
mode => '0640',
tag => $tags,
require => Package['cinder-common'],
}
# cinder-common package
package { 'cinder-common':
name => $::cubbystack::params::cinder_common_package_name,
ensure => present,
tag => $tags,
}
## Cinder configuration files
file { '/etc/cinder':
ensure => directory,
recurse => true,
}
file { '/var/log/cinder': ensure => directory }
file { $config_file: }
# Configure cinder.conf
$settings.each |$setting, $value| {
cubbystack_config { "${config_file}: ${setting}":
value => $value,
tag => $tags,
}
}
}
|