diff --git a/dns/manifests/init.pp b/dns/manifests/init.pp index 56fa1c6..23c1a30 100644 --- a/dns/manifests/init.pp +++ b/dns/manifests/init.pp @@ -261,9 +261,13 @@ class dns::server::ldap inherits dns::server { # Key for dynamic zones. # $keytype: # Key algorithm. Defaults to 'hmac-md5'. +# $contact: +# SOA contact email for autogenerated zones. +# Defaults to hostmaster.$zone. # define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [], - $source = "AUTO", $key = "none", $keytype = "hmac-md5") { + $source = "AUTO", $key = "none", $keytype = "hmac-md5", + $contact = "NONE") { $tmpname = regsubst($name, '([^/]+/)?([0-9]+)/([0-9\.]+\.in-addr\.arpa)', '\1\2-\3') case dirname($tmpname) { @@ -394,6 +398,12 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [], notify => Exec["generate-named-conf"], } } else { + if $contact == "NONE" { + $soacontact = "hostmaster.${zone}" + } else { + $soacontact = $contact + } + file { "${dns::server::chroot}${zonedir}/db.${zonefile}": ensure => present, content => template("dns/db.erb"), diff --git a/dns/templates/db.erb b/dns/templates/db.erb index 7bf9c19..19b260e 100644 --- a/dns/templates/db.erb +++ b/dns/templates/db.erb @@ -5,7 +5,7 @@ $TTL 3600 $ORIGIN <%= zone %>. <% master.each_pair do |k, v| %> -@ IN SOA <%= v['ns'] %>. hostmaster.<%= zone %>. ( +@ IN SOA <%= v['ns'] %>. <%= soacontact %>. ( <%= Time.now.to_i %> ; Serial 3600 ; Refresh 7200 ; Retry