From 9754e64490aaf0afa924887878a187b205e41717 Mon Sep 17 00:00:00 2001 From: Martin Hrabovcin Date: Wed, 11 May 2016 18:32:31 +0200 Subject: [PATCH] Allow to install specific version of fluent plugins --- README.md | 3 ++- manifests/plugin.pp | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8de0fd6..bb3ff5a 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,8 @@ This module gives you the possibility to install plugins as gem or files. **gem installation** ```puppet ::fluentd::plugin { 'fluent-plugin-elasticsearch': - type => 'gem' + type => 'gem', + ensure => '0.1.3' } ``` **file installation** diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c67dd1e..4760686 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -31,11 +31,6 @@ define fluentd::plugin ( $source = undef, ) { - # parameter validation - if ! ($ensure in [ 'present', 'absent' ]) { - fail('ensure parameter must be present or absent') - } - case $type { 'gem': { fluentd::plugin::gem { $name: @@ -44,6 +39,10 @@ define fluentd::plugin ( } } 'file': { + # parameter validation + if ! ($ensure in [ 'present', 'absent' ]) { + fail('ensure parameter must be present or absent') + } validate_string($source) fluentd::plugin::file { $name: