mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-11-13 21:50:34 +00:00
88f021de43
extends the match template, yes, its not pretty readable, to support array definitions for defining multiple server or stores.
40 lines
1.3 KiB
Plaintext
40 lines
1.3 KiB
Plaintext
<match <%= @pattern %>>
|
|
<% @config.each do |key, val| -%>
|
|
<%- if val.is_a?( Hash ) -%>
|
|
<<%= key -%>>
|
|
<%- val.each do |key, val| -%>
|
|
<%= key -%> <%= val %>
|
|
<%- end -%>
|
|
</<%= key %>>
|
|
<%- elsif val.is_a?( Array ) -%>
|
|
<%- val.each do |k, v| -%>
|
|
<<%= key -%>>
|
|
<%- if k.is_a?( Hash ) -%>
|
|
<%- k.each do |x, y| -%>
|
|
<%- if y.is_a?( Array ) -%>
|
|
<%- y.each do |a, b| -%>
|
|
<<%= x -%>>
|
|
<%- if a.is_a?( Hash ) -%>
|
|
<%- a.each do |c, d| -%>
|
|
<%= c -%> <%= d %>
|
|
<%- end -%>
|
|
<%- else -%>
|
|
<%= a -%> <%= b %>
|
|
<%- end -%>
|
|
</<%= x %>>
|
|
<%- end -%>
|
|
<%- else -%>
|
|
<%= x -%> <%= y %>
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- else -%>
|
|
<%= k -%> <%= v %>
|
|
<%- end -%>
|
|
</<%= key %>>
|
|
<%- end -%>
|
|
<%- else -%>
|
|
<%= key -%> <%= val %>
|
|
<%- end -%>
|
|
<% end -%>
|
|
</match>
|