puppet-nova/manifests/config.pp
Tobias Urdin abf035e3b0 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: I53648532bc2aa7031f33b82e2b8486f6927be49d
2019-02-25 22:04:31 +01:00

43 lines
1.2 KiB
Puppet

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