From c1312aa11bcdac0e4052cc6f93f0cee2a1e3a363 Mon Sep 17 00:00:00 2001 From: Jerzy Drozdz Date: Sat, 25 Mar 2017 00:16:24 +0100 Subject: [PATCH] Added logging configuration --- bind/files/redhat/named.conf | 37 ++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/bind/files/redhat/named.conf b/bind/files/redhat/named.conf index 7a9f757..8641a12 100644 --- a/bind/files/redhat/named.conf +++ b/bind/files/redhat/named.conf @@ -14,11 +14,11 @@ options { memstatistics-file "/var/named/data/named_mem_stats.txt"; {#- Allow inclusion of arbitrary statements #} -{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%} +{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {})).items() -%} {%- if value is iterable and value is not string %} {{ statement }} { {%- for item in value %} - {{ item }}; + {{ item }}; {%- endfor %} }; {%- else %} @@ -37,6 +37,39 @@ logging { file "data/named.run"; severity dynamic; }; + +{%- for channel, value in salt['pillar.get']('bind:config:logging:channels', {}).items() -%} + {%- if value is iterable %} + channel {{ channel }} { + {%- for statement, item in value.items() %} + {{ statement }} {{ item }}; + {%- endfor %} + }; + {%- endif %} +{%- endfor %} + +{%- for statement, value in salt['pillar.get']('bind:config:logging:category', {}).items() -%} + category {{ statement }} { + {%- for item in value %} + {{ item }}; + {%- endfor %} + }; +{%- endfor %} + +{%- for statement, value in salt['pillar.get']('bind:config:logging', {}).items() -%} + {%- if statement not in ( 'channels', 'category' ) %} + {%- if value is iterable and value is not string %} + {{ statement }} { + {%- for item in value %} + {{ item }}; + {%- endfor %} + }; + {%- else %} + {{ statement }} {{ value }}; + {%- endif %} + {%- endif %} +{%- endfor %} + }; zone "." IN {