Tobias Urdin 45303fec6d Use validate_legacy
This changes all the puppet 3 validate_* functions
to use the validate_legacy function.

The validate_legacy function has been available since
about three years but require Puppet >= 4.4.0 and since
there is Puppet 4.10.12 as latest we should assume people
are running a fairly new Puppet 4 version.

This is the first step to then remove all validate function
calls and use proper types for parameter as described in spec [1].

[1] https://review.openstack.org/#/c/568929/

Change-Id: Ie0133b0b05a58ffe86e5474c1150f935ca9f30d2
2019-02-23 14:37:16 +01:00

44 lines
1.2 KiB
Puppet

# == Class: cinder::config
#
# This class is used to manage arbitrary cinder configurations.
#
# === Parameters
#
# [*xxx_config*]
# (optional) Allow configuration of arbitrary cinder configurations.
# The value is a hash of xxx_config resources. Example:
# { 'DEFAULT/foo' => { value => 'fooValue'},
# 'DEFAULT/bar' => { value => 'barValue'}
# }
#
# In yaml format, Example:
# xxx_config:
# DEFAULT/foo:
# value: fooValue
# DEFAULT/bar:
# value: barValue
#
# [*cinder_config*]
# (optional) Allow configuration of cinder.conf configurations.
# Defaults to empty hash'{}'
#
# [*api_paste_ini_config*]
# (optional) Allow configuration of /etc/cinder/api-paste.ini configurations.
#
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
class cinder::config (
$cinder_config = {},
$api_paste_ini_config = {},
) {
include ::cinder::deps
validate_legacy(Hash, 'validate_hash', $cinder_config)
validate_legacy(Hash, 'validate_hash', $api_paste_ini_config)
create_resources('cinder_config', $cinder_config)
create_resources('cinder_api_paste_ini', $api_paste_ini_config)
}