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

Unified Diff: modules/fluent/manifests/config.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/lib/puppet/provider/package/td_agent_gem.rb ('k') | modules/fluent/manifests/gem.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/fluent/manifests/config.pp
diff --git a/modules/fluent/manifests/config.pp b/modules/fluent/manifests/config.pp
new file mode 100644
index 0000000000000000000000000000000000000000..3e3b9fc66b67500d9b016f45e9593d3b9089763d
--- /dev/null
+++ b/modules/fluent/manifests/config.pp
@@ -0,0 +1,65 @@
+# == Type: fluent::config
+#
+# Maintain Fluentd configuration files.
+#
+# Use "@include config.d/*.conf" in the main configuration ($fluent::config)
+# to include all fragments at once, or "@include config.d/$name.conf" to pick
+# and choose.
+#
+# Type fluent::config 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/config-file).
+#
+# === Parameters:
+#
+# [*content*]
+# Translates directly into the file $content parameter.
+#
+# [*ensure*]
+# Translates directly into the file $ensure parameter.
+#
+# [*name*]
+# Used as basename (without .conf extension or directory path) when
+# generating the config file $path.
+#
+# [*source*]
+# Translates directly into the file $source parameter.
+#
+# [*target*]
+# Translates directly into the file $target parameter.
+#
+# === Examples:
+#
+# fluent::config {'example1':
+# name => 'my_config',
+# source => 'puppet:///modules/custom/fluentd.conf',
+# }
+#
+# fluent::config {'example2':
+# ensure => 'link',
+# target => '/opt/custom-stuff/fluentd.conf',
+# }
+#
+define fluent::config (
+ $content = undef,
+ $ensure = 'present',
+ $source = undef,
+ $target = undef,
+) {
+
+ include fluent
+ include stdlib
+
+ file {"fluent::config#$title":
+ content => $content,
+ ensure => $ensure,
+ group => $fluent::group,
+ mode => 0640,
+ notify => Service['fluent'],
+ owner => getparam(File['fluent'], 'owner'),
+ path => "$fluent::directory/config.d/$name.conf",
+ require => File["$fluent::directory/config.d"],
+ source => $source,
+ target => $target,
+ }
+}
« no previous file with comments | « modules/fluent/lib/puppet/provider/package/td_agent_gem.rb ('k') | modules/fluent/manifests/gem.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld