From 540a50ea466a060fff75fdbaad60bd6b791e185a Mon Sep 17 00:00:00 2001 From: Max Wilhelm Date: Tue, 1 Dec 2015 15:11:24 +0100 Subject: [PATCH] added parameter validation for fluentd::source --- manifests/source.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/source.pp b/manifests/source.pp index 6807d39..e44d1ca 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -5,6 +5,14 @@ define fluentd::source ( $priority = 10, $config = {}, ) { + + # parameter validation + if ! ($ensure in [ 'present', 'absent' ]) { + fail('ensure parameter must be present or absent') + } + validate_integer($priority) + validate_hash($config) + fluentd::config::file { "source-${title}": ensure => $ensure, priority => $priority,