From eb38e6252b3c52a44d0d33679b3bc3178674c7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 5 May 2023 00:31:37 +0200 Subject: Everything --- templates/key.epp | 8 ++++++++ templates/named-rndc.conf.epp | 5 +++++ templates/named.conf.epp | 13 +++++++++++++ templates/zone.epp | 24 ++++++++++++++++++++++++ templates/zoneconf.epp | 20 ++++++++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 templates/key.epp create mode 100644 templates/named-rndc.conf.epp create mode 100644 templates/named.conf.epp create mode 100644 templates/zone.epp create mode 100644 templates/zoneconf.epp (limited to 'templates') diff --git a/templates/key.epp b/templates/key.epp new file mode 100644 index 0000000..b64ae76 --- /dev/null +++ b/templates/key.epp @@ -0,0 +1,8 @@ +<%- | String $keyname, + String $algorithm, + String $secret, + | -%> +key "<%= $keyname %>" { + algorithm <%= $algorithm %>; + secret "<%= $secret %>"; +}; diff --git a/templates/named-rndc.conf.epp b/templates/named-rndc.conf.epp new file mode 100644 index 0000000..5c56cce --- /dev/null +++ b/templates/named-rndc.conf.epp @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..c8f7fda --- /dev/null +++ b/templates/named.conf.epp @@ -0,0 +1,13 @@ +options { + directory "<%= $dns::zone_directory %>"; + forwarers { 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.epp b/templates/zone.epp new file mode 100644 index 0000000..76fac34 --- /dev/null +++ b/templates/zone.epp @@ -0,0 +1,24 @@ +<%- | String $zone, + String $mname, + String $rname, + String $serial, + String $refresh, + String $retry, + String $expire, + String $negative_ttl, + String $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/zoneconf.epp b/templates/zoneconf.epp new file mode 100644 index 0000000..cb702be --- /dev/null +++ b/templates/zoneconf.epp @@ -0,0 +1,20 @@ +<%- | String $zone, + String $type, + String $update_policy, + | -%> +<%# one zone entry for the bind9 configuration file %> +zone "<%= $zone %>" { + type <%= $type %>; + file "zones/<%= $zone %>.db"; + + <%- if $type == 'master' or $type == 'slave' { %> + journal "journal/<%= $zone %>.jnl"; + <%- } %> + + + <%- if $update_policy { %> + update-policy { + <%= $update_policy %>; + }; + <%- } %> +}; -- cgit v1.2.3