puppet-vitrage/manifests/config.pp
Tobias Urdin bfa686fd9b 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: Ie51ec044002f5aae1b4c95c19db3d44a2c16c50f
2019-03-04 09:50:52 +00:00

39 lines
1.1 KiB
Puppet

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