1
0
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:
Jan Krause
2015-12-11 10:21:27 +01:00
parent b5d8088d31
commit 88f021de43
5 changed files with 145 additions and 16 deletions

View File

@@ -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 -%>