From ce9a65a4e46b92912202882704c8484224ca6a1b Mon Sep 17 00:00:00 2001 From: Max Wilhelm Date: Tue, 1 Dec 2015 14:18:06 +0100 Subject: [PATCH] added fluentd::source definition --- manifests/config/file.pp | 2 +- manifests/source.pp | 13 +++++++++++++ templates/source.erb | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 manifests/source.pp create mode 100644 templates/source.erb diff --git a/manifests/config/file.pp b/manifests/config/file.pp index 2a69013..40f4e26 100644 --- a/manifests/config/file.pp +++ b/manifests/config/file.pp @@ -4,7 +4,7 @@ define fluentd::config::file ( $ensure = present, $priority = 50, - $content, + $content = undef, ) { $base_name = "${title}.conf" diff --git a/manifests/source.pp b/manifests/source.pp new file mode 100644 index 0000000..6807d39 --- /dev/null +++ b/manifests/source.pp @@ -0,0 +1,13 @@ +# Configure a fluentd source +# +define fluentd::source ( + $ensure = present, + $priority = 10, + $config = {}, +) { + fluentd::config::file { "source-${title}": + ensure => $ensure, + priority => $priority, + content => template( 'fluentd/source.erb'), + } +} diff --git a/templates/source.erb b/templates/source.erb new file mode 100644 index 0000000..503c9f9 --- /dev/null +++ b/templates/source.erb @@ -0,0 +1,5 @@ + +<% @config.each do |key, val| -%> + <%= key -%> <%= val %> +<% end -%> +