Skip to content

Commit 32459c7

Browse files
authored
Merge pull request #94 from netmanagers/refactor-named.conf.local_and_logging
Refactor named.conf.local & logging
2 parents 02ff055 + 45e8128 commit 32459c7

File tree

12 files changed

+34
-451
lines changed

12 files changed

+34
-451
lines changed

bind/config.sls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bind_config:
5959
bind_local_config:
6060
file.managed:
6161
- name: {{ map.local_config }}
62-
- source: 'salt://{{ map.config_source_dir }}/named.conf.local'
62+
- source: salt://bind/files/named.conf.local.jinja
6363
- template: jinja
6464
- user: {{ salt['pillar.get']('bind:config:user', map.user) }}
6565
- group: {{ salt['pillar.get']('bind:config:group', map.group) }}
@@ -140,7 +140,7 @@ bind_default_zones:
140140
bind_logging_config:
141141
file.managed:
142142
- name: {{ map.logging_config }}
143-
- source: salt://{{ map.config_source_dir }}/named.conf.logging
143+
- source: salt://bind/files/named.conf.logging.jinja
144144
- template: jinja
145145
- user: {{ salt['pillar.get']('bind:config:user', map.user) }}
146146
- group: {{ salt['pillar.get']('bind:config:group', map.group) }}

bind/files/arch/named.conf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,4 @@ zone "." IN {
6464
// allow-transfer { any; };
6565
//};
6666

67-
//logging {
68-
// channel xfer-log {
69-
// file "/var/log/named.log";
70-
// print-category yes;
71-
// print-severity yes;
72-
// severity info;
73-
// };
74-
// category xfer-in { xfer-log; };
75-
// category xfer-out { xfer-log; };
76-
// category notify { xfer-log; };
77-
//};
78-
7967
include "{{ map.local_config }}";

bind/files/arch/named.conf.local

Lines changed: 0 additions & 57 deletions
This file was deleted.

bind/files/freebsd/named.conf.local

Lines changed: 0 additions & 113 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ match-clients {
109109
};
110110
{%- endfor %}
111111

112+
{%- if salt['pillar.get']('bind:config:enable_logging', True) %}
112113
{%- if salt['pillar.get']('bind:config:use_extensive_logging', False) %}
113114
include "{{ map.logging_config }}";
114115
{% else %}
@@ -120,6 +121,7 @@ logging {
120121
category queries { querylog; };
121122
};
122123
{%- endif %}
124+
{%- endif %}
123125

124126
{%- if salt['pillar.get']('bind:controls', False) %}
125127
controls {

bind/files/redhat/named.conf

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,46 +32,6 @@ options {
3232
managed-keys-directory "/var/named/dynamic";
3333
};
3434

35-
logging {
36-
channel default_debug {
37-
file "data/named.run";
38-
severity dynamic;
39-
};
40-
41-
{%- for channel, value in salt['pillar.get']('bind:config:logging:channels', {}).items() -%}
42-
{%- if value is iterable %}
43-
channel {{ channel }} {
44-
{%- for statement, item in value.items() %}
45-
{{ statement }} {{ item }};
46-
{%- endfor %}
47-
};
48-
{%- endif %}
49-
{%- endfor %}
50-
51-
{%- for statement, value in salt['pillar.get']('bind:config:logging:category', {}).items() %}
52-
category {{ statement }} {
53-
{%- for item in value %}
54-
{{ item }};
55-
{%- endfor %}
56-
};
57-
{%- endfor %}
58-
59-
{%- for statement, value in salt['pillar.get']('bind:config:logging', {}).items() -%}
60-
{%- if statement not in ( 'channels', 'category' ) %}
61-
{%- if value is iterable and value is not string %}
62-
{{ statement }} {
63-
{%- for item in value %}
64-
{{ item }};
65-
{%- endfor %}
66-
};
67-
{%- else %}
68-
{{ statement }} {{ value }};
69-
{%- endif %}
70-
{%- endif %}
71-
{%- endfor %}
72-
73-
};
74-
7535
zone "." IN {
7636
type hint;
7737
file "named.ca";

bind/files/redhat/named.conf.local

Lines changed: 0 additions & 82 deletions
This file was deleted.

bind/files/suse/named.conf

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -108,37 +108,6 @@ options {
108108

109109
};
110110

111-
# To configure named's logging remove the leading '#' characters of the
112-
# following examples.
113-
#logging {
114-
# # Log queries to a file limited to a size of 100 MB.
115-
# channel query_logging {
116-
# file "/var/log/named_querylog"
117-
# versions 3 size 100M;
118-
# print-time yes; // timestamp log entries
119-
# };
120-
# category queries {
121-
# query_logging;
122-
# };
123-
#
124-
# # Or log this kind alternatively to syslog.
125-
# channel syslog_queries {
126-
# syslog user;
127-
# severity info;
128-
# };
129-
# category queries { syslog_queries; };
130-
#
131-
# # Log general name server errors to syslog.
132-
# channel syslog_errors {
133-
# syslog user;
134-
# severity error;
135-
# };
136-
# category default { syslog_errors; };
137-
#
138-
# # Don't log lame server messages.
139-
# category lame-servers { null; };
140-
#};
141-
142111
# The following zone definitions don't need any modification. The first one
143112
# is the definition of the root name servers. The second one defines
144113
# localhost while the third defines the reverse lookup for localhost.

0 commit comments

Comments
 (0)