mirror of
https://github.com/krislamo/puppet-fluentd
synced 2025-09-11 16:19:29 +00:00
allow repeating keys in match rules
extends the match template, yes, its not pretty readable, to support array definitions for defining multiple server or stores.
This commit is contained in:
@@ -6,6 +6,32 @@
|
||||
<%= 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 -%>
|
||||
|
Reference in New Issue
Block a user