
This patch aims to - configure a default type in cinder-volume (without it, a volume can't boot without explicitly specifying a type from the client, which could lead to errors) - add unit tests for cinder::backends class Change-Id: Ia0a475a629576596dd60e513bf0764e9bc3000ab Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
41 lines
1.0 KiB
Puppet
41 lines
1.0 KiB
Puppet
# == Class: cinder::backends
|
|
#
|
|
# Class to set the enabled_backends list
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*enabled_backends*]
|
|
# (required) a list of ini sections to enable.
|
|
# This should contain names used in ceph::backend::* resources.
|
|
# Example: ['volume1', 'volume2', 'sata3']
|
|
#
|
|
# [*default_volume_type*]
|
|
# (optional) default volume type to use.
|
|
# This should contain the name of the default volume type to use.
|
|
# If not configured, it produces an error when creating a volume
|
|
# without specifying a type.
|
|
# Defaults to 'false'.
|
|
#
|
|
# Author: Andrew Woodward <awoodward@mirantis.com>
|
|
class cinder::backends (
|
|
$enabled_backends = undef,
|
|
$default_volume_type = false
|
|
){
|
|
|
|
# Maybe this could be extented to dynamicly find the enabled names
|
|
cinder_config {
|
|
'DEFAULT/enabled_backends': value => join($enabled_backends, ',');
|
|
}
|
|
|
|
if $default_volume_type {
|
|
cinder_config {
|
|
'DEFAULT/default_volume_type': value => $default_volume_type;
|
|
}
|
|
} else {
|
|
cinder_config {
|
|
'DEFAULT/default_volume_type': ensure => absent;
|
|
}
|
|
}
|
|
|
|
}
|