Index: modules/fluent/manifests/plugin.pp |
diff --git a/modules/fluent/manifests/plugin.pp b/modules/fluent/manifests/plugin.pp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e72c0bcfb9653a4d43d191b7e27e0faf3129e1e |
--- /dev/null |
+++ b/modules/fluent/manifests/plugin.pp |
@@ -0,0 +1,61 @@ |
+# == Type: fluent::plugin |
+# |
+# Maintain Fluentd plugin files. |
+# |
+# Type fluent::plugin is a thin layer around a single Puppet file resource |
+# definition, combining the available parameters with ones computed internally |
+# (aligned with http://docs.fluentd.org/articles/plugin-management). |
+# |
+# === Parameters: |
+# |
+# [*content*] |
+# Translates directly into the file $content parameter. |
+# |
+# [*ensure*] |
+# Translates directly into the file $ensure parameter. |
+# |
+# [*name*] |
+# Used as basename (without .rb extension or directory path) when |
+# generating the plugin file $path. |
+# |
+# [*source*] |
+# Translates directly into the file $source parameter. |
+# |
+# [*target*] |
+# Translates directly into the file $target parameter. |
+# |
+# === Examples: |
+# |
+# fluent::plugin {'example1': |
+# name => 'my_plugin', |
+# source => 'puppet:///modules/custom/fluentd/plugin.rb', |
+# } |
+# |
+# fluent::plugin {'example2': |
+# ensure => 'link', |
+# target => '/opt/custom-fluentd-stuff/plugin.rb', |
+# } |
+# |
+define fluent::plugin ( |
+ $content = undef, |
+ $ensure = 'present', |
+ $source = undef, |
+ $target = undef, |
+) { |
+ |
+ include fluent |
+ include stdlib |
+ |
+ file {"fluent::plugin#$title": |
+ content => $content, |
+ ensure => $ensure, |
+ group => $fluent::group, |
+ mode => 0640, |
+ notify => Service['fluent'], |
+ owner => getparam(File['fluent'], 'owner'), |
+ path => "$fluent::directory/plugin/$name.rb", |
+ require => File["$fluent::directory/plugin"], |
+ source => $source, |
+ target => $target, |
+ } |
+} |