mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-11-13 21:50:34 +00:00
added fluentd::match definition
This commit is contained in:
parent
4c880b1a9b
commit
49857ddb1d
14
manifests/match.pp
Normal file
14
manifests/match.pp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Configure a fluentd match
|
||||||
|
#
|
||||||
|
define fluentd::match (
|
||||||
|
$ensure = present,
|
||||||
|
$priority = 30,
|
||||||
|
$pattern = '',
|
||||||
|
$config = {},
|
||||||
|
) {
|
||||||
|
fluentd::config::file { "match-${title}":
|
||||||
|
ensure => $ensure,
|
||||||
|
priority => $priority,
|
||||||
|
content => template( 'fluentd/match.erb'),
|
||||||
|
}
|
||||||
|
}
|
13
templates/match.erb
Normal file
13
templates/match.erb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<match <%= @pattern %>>
|
||||||
|
<% @config.each do |key, val| -%>
|
||||||
|
<%- if val.is_a?( Hash ) -%>
|
||||||
|
<<%= key -%>>
|
||||||
|
<%- val.each do |key, val| -%>
|
||||||
|
<%= key -%> <%= val %>
|
||||||
|
<%- end -%>
|
||||||
|
</<%= key %>>
|
||||||
|
<%- else -%>
|
||||||
|
<%= key -%> <%= val %>
|
||||||
|
<%- end -%>
|
||||||
|
<% end -%>
|
||||||
|
</match>
|
Loading…
Reference in New Issue
Block a user