From 812c3f4d6162cf7af8f8cbedb6abb6d72bd537e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 5 May 2023 01:46:46 +0200 Subject: "Working" product. --- templates/named-rndc.conf.epp | 2 +- templates/named.conf.epp | 6 ++---- templates/zone-serial.epp | 3 +++ templates/zone.epp | 24 ------------------------ templates/zone1.epp | 15 +++++++++++++++ templates/zone2.epp | 14 ++++++++++++++ templates/zoneconf.epp | 6 +++--- 7 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 templates/zone-serial.epp delete mode 100644 templates/zone.epp create mode 100644 templates/zone1.epp create mode 100644 templates/zone2.epp (limited to 'templates') diff --git a/templates/named-rndc.conf.epp b/templates/named-rndc.conf.epp index 5c56cce..fd069a5 100644 --- a/templates/named-rndc.conf.epp +++ b/templates/named-rndc.conf.epp @@ -2,4 +2,4 @@ include "<%= $dns::rndc_key_file %>"; controls { inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { "rndc-key"; }; -} +}; diff --git a/templates/named.conf.epp b/templates/named.conf.epp index c8f7fda..9fe10b1 100644 --- a/templates/named.conf.epp +++ b/templates/named.conf.epp @@ -1,12 +1,10 @@ options { - directory "<%= $dns::zone_directory %>"; - forwarers { 8.8.8.8; 8.8.4.4; }; + directory "<%= $dns::directory %>"; + forwarders { 8.8.8.8; 8.8.4.4; }; recursion yes; allow-query { any; }; dnssec-validation yes; - empty-zone-enable yes; - listen-on-v6 { any; }; allow-recursion { localnets; localhost; }; diff --git a/templates/zone-serial.epp b/templates/zone-serial.epp new file mode 100644 index 0000000..ba8ded9 --- /dev/null +++ b/templates/zone-serial.epp @@ -0,0 +1,3 @@ +<%- | Integer[0,4294967295] $serial, + | -%> + <%= $serial %> ; Serial diff --git a/templates/zone.epp b/templates/zone.epp deleted file mode 100644 index 7f374d2..0000000 --- a/templates/zone.epp +++ /dev/null @@ -1,24 +0,0 @@ -<%- | String $zone, - String $mname, - String $rname, - Integer[0,4294967295] $serial, - Dns::Ttl $refresh, - Dns::Ttl $retry, - Dns::Ttl $expire, - Dns::Ttl $negative_ttl, - Dns::Ttl $default_ttl, - | -%> - -<%# The actual zonefile %> -; File managed by Puppet. -; Local changes WILL be overwritten! -$ORIGIN <%= $zone %> -$TTL <%= $default_ttl %> - -@ SOA <%= $mname %> <%= $rname %> ( - <%= $serial %> - <%= $refresh %> - <%= $retry %> - <%= $expire %> - <%= $negative_ttl %> - ) diff --git a/templates/zone1.epp b/templates/zone1.epp new file mode 100644 index 0000000..289fc2d --- /dev/null +++ b/templates/zone1.epp @@ -0,0 +1,15 @@ +<%- | String $zone, + String $mname, + String $rname, + Dns::Ttl $default_ttl, + Optional[Dns::Ttl] $soa_ttl, + | -%> +<%# +First half of the Zonefile's header, up until the serial field. +-%> +; File managed by Puppet. +; Local changes WILL be overwritten! +$ORIGIN <%= $zone %> +$TTL <%= $default_ttl %> + +@ <%= $soa_ttl %> IN SOA <%= $mname %> <%= $rname %> ( diff --git a/templates/zone2.epp b/templates/zone2.epp new file mode 100644 index 0000000..0663466 --- /dev/null +++ b/templates/zone2.epp @@ -0,0 +1,14 @@ +<%- | Dns::Ttl $refresh, + Dns::Ttl $retry, + Dns::Ttl $expire, + Dns::Ttl $negative_ttl, + | -%> +<%# +Second half of the Zonefile's header. Everything after the serial +fiel.d +-%> + <%= $refresh %> ; Refresh + <%= $retry %> ; Retry + <%= $expire %> ; Expire + <%= $negative_ttl %> ; Negative TTL + ) diff --git a/templates/zoneconf.epp b/templates/zoneconf.epp index cb702be..af0d6af 100644 --- a/templates/zoneconf.epp +++ b/templates/zoneconf.epp @@ -1,14 +1,14 @@ <%- | String $zone, String $type, - String $update_policy, + Optional[String] $update_policy, | -%> <%# one zone entry for the bind9 configuration file %> zone "<%= $zone %>" { type <%= $type %>; - file "zones/<%= $zone %>.db"; + file "zones/<%= $zone %>db"; <%- if $type == 'master' or $type == 'slave' { %> - journal "journal/<%= $zone %>.jnl"; + journal "journal/<%= $zone %>jnl"; <%- } %> -- cgit v1.2.3