puppet/dns/templates/generate-named-conf.sh.erb

58 lines
1.1 KiB
Text

#!/bin/sh
chroot="<%= chroot %>"
confdir="<%= confdir %>"
operatingsystem="<%= operatingsystem %>"
cat <<EOF
include "${confdir}/named.conf.local";
include "${confdir}/named.conf.options";
view default {
match-clients { any; };
EOF
for name in ${chroot}${confdir}/zone.* ; do
echo " include \"${confdir}/`basename ${name}`\";"
done
case $operatingsystem in
OpenBSD)
cat <<EOF
zone "." {
type hint;
file "/etc/root.hint";
};
zone "localhost" {
type master;
file "/standard/localhost";
};
zone "127.in-addr.arpa" {
type master;
file "/standard/loopback";
};
zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" {
type master;
file "/standard/loopback6.arpa";
};
EOF
;;
Ubuntu)
echo " include \"${confdir}/named.conf.default-zones\";"
;;
*)
cat <<EOF
zone "." {
type hint;
file "/var/named/named.ca";
};
EOF
cat ${chroot}/etc/named.rfc1912.zones | \
sed -e 's%file "%file "/var/named/%' -e 's/^/ /'
;;
esac
echo "};"
echo ""