#
# Configure DNS setup with bind 
#
directories:
  debian.server::
    # Make sure the members of group 'bind' can write to /etc/bind/:
    /etc/bind mode=2775 owner=root group=bind

editfiles:
  debian.server.installation::
    # Configure ldap2bind for Debian Edu:
    { /etc/bind/named.conf.local
        AppendIfNoSuchLine 'include "/etc/bind/named.conf.ldap2zone";'
    }
    # Disable IPv6 (to silence IPv6 lookup failure messages): 
    { /etc/default/bind9
        BeginGroupIfNoSuchLine 'OPTIONS="-4 -u bind"'
          HashCommentLinesStarting 'OPTIONS='
          LocateLineMatching '#.*OPTIONS=.*'
          InsertLine 'OPTIONS="-4 -u bind"'
        EndGroup
    }
    # Add alias for mails to user bind:
    { /etc/aliases
        AppendIfNoSuchLine 'bind: root'
    }
