puppet-murano/manifests/config.pp
Tobias Urdin 52f9b4c5f7 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: I4da049ff59fd71403f4d00cfad8c5f56041e1e6e
2019-02-23 23:23:09 +01:00

51 lines
1.6 KiB
Puppet

# == Class: murano::config
#
# This class is used to manage arbitrary murano configurations.
#
# === Parameters
#
# [*murano_config*]
# (optional) Allow configuration of arbitrary murano configurations.
# The value is an hash of murano_config resources. Example:
# { 'DEFAULT/foo' => { value => 'fooValue'},
# 'DEFAULT/bar' => { value => 'barValue'}
# }
# In yaml format, Example:
# murano_config:
# DEFAULT/foo:
# value: fooValue
# DEFAULT/bar:
# value: barValue
#
# [*murano_cfapi_config*]
# (optional) Allow configuration of CFAPI Murano service
#
# [*murano_paste_config*]
# (optional) Allow configuration of arbitrary murano paste configurations.
#
# [*murano_cfapi_paste_config*]
# (optional) Allow configuration of CFAPI Murano paste configurations.
#
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
class murano::config (
$murano_config = {},
$murano_cfapi_config = {},
$murano_paste_config = {},
$murano_cfapi_paste_config = {}
) {
include ::murano::deps
validate_legacy(Hash, 'validate_hash', $murano_config)
validate_legacy(Hash, 'validate_hash', $murano_cfapi_config)
validate_legacy(Hash, 'validate_hash', $murano_paste_config)
validate_legacy(Hash, 'validate_hash', $murano_cfapi_paste_config)
create_resources('murano_config', $murano_config)
create_resources('murano_cfapi_config', $murano_cfapi_config)
create_resources('murano_paste_ini_config', $murano_paste_config)
create_resources('murano_cfapi_paste_ini_config', $murano_cfapi_paste_config)
}