Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/fluent/manifests/gem.pp

Issue 29338665: Issue 3694 - Introduce module fluent (Closed)
Patch Set: Created March 18, 2016, 6:06 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/fluent/manifests/config.pp ('k') | modules/fluent/manifests/init.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/fluent/manifests/gem.pp
diff --git a/modules/fluent/manifests/gem.pp b/modules/fluent/manifests/gem.pp
new file mode 100644
index 0000000000000000000000000000000000000000..a85b07426a8afee50faf569eca6df04c3c738754
--- /dev/null
+++ b/modules/fluent/manifests/gem.pp
@@ -0,0 +1,56 @@
+# == Type: fluent::gem
+#
+# Maintain Fluentd (plugin) gems.
+#
+# Type fluentd::gem is a thin layer around a single Puppet package resource
+# definition, combining the available parameters with ones computed internally
+# (aligned with http://docs.fluentd.org/articles/plugin-management#fluent-gem)
+# and determining the proper default package provider (module fluent includes
+# specialized providers using the gem command that ships with Fluentd, see the
+# *.rb files in modules/fluent/lib/puppet/provider/package for details).#
+#
+# === Parameters:
+#
+# [*ensure*]
+# Translates directly into the package $ensure parameter.
+#
+# [*name*]
+# Translates directly into the package $name parameter.
+#
+# [*provider*]
+# Translates directly into the package $provider parameter.
+#
+# === Examples:
+#
+# fluent::gem {[
+# 'fluent-plugin-secure-forward',
+# 'fluent-plugin-grep',
+# ]:
+# ensure => 'latest',
+# }
+#
+define fluent::gem (
+ $ensure = 'present',
+ $provider = getparam(Package['fluent'], 'name') ? {
+ /\btd[_\-]/ => 'td_agent_gem',
+ default => 'fluent_gem',
+ }
+) {
+
+ include fluent
+ include stdlib
+
+ # Returns undef if Service['fluent'] is not defined
+ $notify = getparam(Service['fluent'], 'ensure') ? {
+ /^(running|true)$/ => Service['fluent'],
+ default => [],
+ }
+
+ package {$title:
+ ensure => $ensure,
+ name => $name,
+ notify => $notify,
+ provider => $provider,
+ require => Package['fluent'],
+ }
+}
« no previous file with comments | « modules/fluent/manifests/config.pp ('k') | modules/fluent/manifests/init.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld