Skip to content

Commit 7415a9b

Browse files
mgomersbachmyii
authored andcommitted
feat(map.jinja): add Gentoo support
1 parent b7b0d65 commit 7415a9b

File tree

3 files changed

+132
-1
lines changed

3 files changed

+132
-1
lines changed

bind/config.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bind_local_config:
100100
- watch_in:
101101
- service: bind
102102
103-
{% if grains['os_family'] not in ['Arch', 'FreeBSD'] %}
103+
{% if grains['os_family'] not in ['Arch', 'FreeBSD', 'Gentoo'] %}
104104
bind_default_config:
105105
file.managed:
106106
- name: {{ map.default_config }}

bind/files/gentoo/named.conf

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/*
2+
* Refer to the named.conf(5) and named(8) man pages, and the documentation
3+
* in /usr/share/doc/bind-* for more details.
4+
* Online versions of the documentation can be found here:
5+
* https://kb.isc.org/article/AA-01031
6+
*
7+
* If you are going to set up an authoritative server, make sure you
8+
* understand the hairy details of how DNS works. Even with simple mistakes,
9+
* you can break connectivity for affected parties, or cause huge amounts of
10+
* useless Internet traffic.
11+
*/
12+
13+
options {
14+
directory "{{ map.get('named_directory') }}";
15+
pid-file "/run/named/named.pid";
16+
17+
bindkeys-file "/etc/bind/bind.keys";
18+
19+
{%- if salt['pillar.get']('bind:config:ipv6', False) %}
20+
listen-on-v6 { {{ salt['pillar.get']('bind:config:ipv6_listen', 'any') }}; };
21+
{%- endif %}
22+
23+
listen-on { 127.0.0.1; };
24+
25+
{%- for statement, value in salt['pillar.get']('bind:config:options', {})|dictsort -%}
26+
{%- if value is iterable and value is not string %}
27+
{{ statement }} {
28+
{%- for item in value %}
29+
{{ item }};
30+
{%- endfor %}
31+
};
32+
{%- else %}
33+
{{ statement }} {{ value }};
34+
{%- endif %}
35+
{%- endfor %}
36+
};
37+
38+
{% for incl in salt['pillar.get']('bind:config:includes', []) %}
39+
include "{{ incl }}";
40+
{% endfor %}
41+
42+
43+
{%- if salt['pillar.get']('bind:controls', False) %}
44+
controls {
45+
{%- for name, control in salt['pillar.get']('bind:controls')|dictsort if control.get('enabled', True) %}
46+
inet {{ control.get('bind', {}).get('address', '127.0.0.1') }} port {{ control.get('bind', {}).get('port', 953) }}
47+
{%- if control.get('allow') %}
48+
allow {
49+
{%- for allow in control.allow %}
50+
{{ allow }};
51+
{%- endfor %}
52+
}
53+
{%- endif %}
54+
{%- if control.get('keys') %}
55+
keys {
56+
{%- for key in control.get('keys') %}
57+
{{ key }};
58+
{%- endfor %}
59+
}
60+
{%- endif %};
61+
{%- endfor %}
62+
63+
};
64+
{%- endif %}
65+
66+
zone "." in {
67+
type hint;
68+
file "/var/bind/named.cache";
69+
};
70+
71+
zone "localhost" IN {
72+
type master;
73+
file "pri/localhost.zone";
74+
notify no;
75+
};
76+
77+
/*
78+
* Briefly, a zone which has been declared delegation-only will be effectively
79+
* limited to containing NS RRs for subdomains, but no actual data beyond its
80+
* own apex (for example, its SOA RR and apex NS RRset). This can be used to
81+
* filter out "wildcard" or "synthesized" data from NAT boxes or from
82+
* authoritative name servers whose undelegated (in-zone) data is of no
83+
* interest.
84+
* See http://www.isc.org/software/bind/delegation-only for more info
85+
*/
86+
87+
//zone "COM" { type delegation-only; };
88+
//zone "NET" { type delegation-only; };
89+
90+
//zone "YOUR-DOMAIN.TLD" {
91+
// type master;
92+
// file "/var/bind/pri/YOUR-DOMAIN.TLD.zone";
93+
// allow-query { any; };
94+
// allow-transfer { xfer; };
95+
//};
96+
97+
//zone "YOUR-SLAVE.TLD" {
98+
// type slave;
99+
// file "/var/bind/sec/YOUR-SLAVE.TLD.zone";
100+
// masters { <MASTER>; };
101+
102+
/* Anybody is allowed to query but transfer should be controlled by the master. */
103+
// allow-query { any; };
104+
// allow-transfer { none; };
105+
106+
/* The master should be the only one who notifies the slaves, shouldn't it? */
107+
// allow-notify { <MASTER>; };
108+
// notify no;
109+
//};
110+
111+
include "{{ map.local_config }}";

bind/map.jinja

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,26 @@
9595
'key_algorithm_field': '008',
9696
'key_size': '4096',
9797
},
98+
'Gentoo': {
99+
'pkgs': ['net-dns/bind', 'net-dns/bind-tools', 'net-dns/dnssec-tools'],
100+
'service': 'named',
101+
'config_source_dir': 'bind/files/gentoo',
102+
'zones_source_dir': 'zones',
103+
'config': '/etc/bind/named.conf',
104+
'local_config': '/etc/bind/named.conf.local',
105+
'named_directory': '/var/bind',
106+
'zones_directory': '/var/bind/pri',
107+
'chroot_dir': '',
108+
'log_dir': '/var/log/named',
109+
'log_mode': '660',
110+
'user': 'root',
111+
'group': 'named',
112+
'mode': '640',
113+
'key_directory': '/var/bind/dyn',
114+
'key_algorithm': 'RSASHA256',
115+
'key_algorithm_field': '008',
116+
'key_size': '4096',
117+
},
98118
'Suse': {
99119
'pkgs': ['bind'],
100120
'service': 'named',

0 commit comments

Comments
 (0)