From 9754e64490aaf0afa924887878a187b205e41717 Mon Sep 17 00:00:00 2001 From: Martin Hrabovcin Date: Wed, 11 May 2016 18:32:31 +0200 Subject: [PATCH 1/2] 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: From 75a537432cf068bda28f1629d675893d313421ba Mon Sep 17 00:00:00 2001 From: Martin Hrabovcin Date: Thu, 12 May 2016 22:31:52 +0200 Subject: [PATCH 2/2] Fix tests for Puppet 4 --- spec/classes/fluentd_config_spec.rb | 1 + spec/classes/fluentd_install_spec.rb | 1 + spec/classes/fluentd_repo_spec.rb | 1 + spec/classes/fluentd_service_spec.rb | 1 + spec/classes/fluentd_spec.rb | 1 + spec/classes/fluentd_user_spec.rb | 1 + spec/defines/filter_spec.rb | 1 + spec/defines/match_spec.rb | 1 + spec/defines/plugin_spec.rb | 1 + spec/defines/source_spec.rb | 1 + 10 files changed, 10 insertions(+) diff --git a/spec/classes/fluentd_config_spec.rb b/spec/classes/fluentd_config_spec.rb index 395f2a2..aa4e1e3 100644 --- a/spec/classes/fluentd_config_spec.rb +++ b/spec/classes/fluentd_config_spec.rb @@ -27,6 +27,7 @@ describe 'fluentd::config', :type => :class do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } diff --git a/spec/classes/fluentd_install_spec.rb b/spec/classes/fluentd_install_spec.rb index 9a5e7f0..da08766 100644 --- a/spec/classes/fluentd_install_spec.rb +++ b/spec/classes/fluentd_install_spec.rb @@ -19,6 +19,7 @@ describe 'fluentd::install', :type => :class do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } include_examples 'when called with no parameters' diff --git a/spec/classes/fluentd_repo_spec.rb b/spec/classes/fluentd_repo_spec.rb index 6ad8b4f..e7b92c2 100644 --- a/spec/classes/fluentd_repo_spec.rb +++ b/spec/classes/fluentd_repo_spec.rb @@ -9,6 +9,7 @@ describe 'fluentd::repo', :type => :class do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } it { diff --git a/spec/classes/fluentd_service_spec.rb b/spec/classes/fluentd_service_spec.rb index c7789e6..16c00a3 100644 --- a/spec/classes/fluentd_service_spec.rb +++ b/spec/classes/fluentd_service_spec.rb @@ -20,6 +20,7 @@ describe 'fluentd::config', :type => :class do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } diff --git a/spec/classes/fluentd_spec.rb b/spec/classes/fluentd_spec.rb index 696e0f7..989f7f1 100644 --- a/spec/classes/fluentd_spec.rb +++ b/spec/classes/fluentd_spec.rb @@ -17,6 +17,7 @@ describe 'fluentd', :type => :class do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } diff --git a/spec/classes/fluentd_user_spec.rb b/spec/classes/fluentd_user_spec.rb index fcf37ad..b468640 100644 --- a/spec/classes/fluentd_user_spec.rb +++ b/spec/classes/fluentd_user_spec.rb @@ -18,6 +18,7 @@ describe 'fluentd::user', :type => :class do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } diff --git a/spec/defines/filter_spec.rb b/spec/defines/filter_spec.rb index b29de21..87e9c74 100644 --- a/spec/defines/filter_spec.rb +++ b/spec/defines/filter_spec.rb @@ -7,6 +7,7 @@ describe 'fluentd::filter' do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } let(:pre_condition) { 'include fluentd' } diff --git a/spec/defines/match_spec.rb b/spec/defines/match_spec.rb index f662b3e..82a564c 100644 --- a/spec/defines/match_spec.rb +++ b/spec/defines/match_spec.rb @@ -7,6 +7,7 @@ describe 'fluentd::match' do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } let(:pre_condition) { 'include fluentd' } diff --git a/spec/defines/plugin_spec.rb b/spec/defines/plugin_spec.rb index 498d5f6..3ea3878 100644 --- a/spec/defines/plugin_spec.rb +++ b/spec/defines/plugin_spec.rb @@ -7,6 +7,7 @@ describe 'fluentd::plugin' do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } let(:pre_condition) { 'include fluentd' } diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index b09f776..996869f 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -7,6 +7,7 @@ describe 'fluentd::source' do :lsbdistid => 'Ubuntu', :operatingsystem => 'Ubuntu', :lsbdistcodename => 'precise', + :architecture => 'amd64', } } let(:pre_condition) { 'include fluentd' }