puppet-tempest/manifests/config.pp
Tobias Urdin b15d4005cd 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: Ic78b27163bfada850e246de4765fcc130db2b49b
2019-02-23 23:00:40 +01:00

38 lines
1.2 KiB
Puppet

# == Class: tempest::config
#
# This class is used to manage arbitrary Tempest configurations.
#
# === Parameters
#
# [*tempest_config*]
# (optional) Allow configuration of arbitrary Tempest configurations.
# Note: The tempest_config provider does not hard-code the path
# of the tempest config file so that tempest can be run out of temporary
# locations (i.e. /tmp/tempest). For this reason, you MUST pass "path"
# in this hash.
# The value is an hash of tempest_config resources. Example:
# {
# 'DEFAULT/foo' => { path => '/tmp/tempest/etc/tempest.conf'; value => 'fooValue'},
# 'DEFAULT/bar' => { path => '/tmp/tempest/etc/tempest.conf'; value => 'fooValue'},
# }
# In yaml format, Example:
# tempest_config:
# DEFAULT/foo:
# value: fooValue
# path: /tmp/tempest/etc/tempest.conf
# DEFAULT/bar:
# value: barValue
# path: /tmp/tempest/etc/tempest.conf
#
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
class tempest::config (
$tempest_config = {},
) {
validate_legacy(Hash, 'validate_hash', $tempest_config)
create_resources('tempest_config', $tempest_config)
}