Added contact parameter for autogenerated dns zones
This commit is contained in:
parent
8b70966a7d
commit
aa9dc23e73
2 changed files with 12 additions and 2 deletions
|
@ -261,9 +261,13 @@ class dns::server::ldap inherits dns::server {
|
||||||
# Key for dynamic zones.
|
# Key for dynamic zones.
|
||||||
# $keytype:
|
# $keytype:
|
||||||
# Key algorithm. Defaults to 'hmac-md5'.
|
# 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 = [],
|
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')
|
$tmpname = regsubst($name, '([^/]+/)?([0-9]+)/([0-9\.]+\.in-addr\.arpa)', '\1\2-\3')
|
||||||
case dirname($tmpname) {
|
case dirname($tmpname) {
|
||||||
|
@ -394,6 +398,12 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
|
||||||
notify => Exec["generate-named-conf"],
|
notify => Exec["generate-named-conf"],
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if $contact == "NONE" {
|
||||||
|
$soacontact = "hostmaster.${zone}"
|
||||||
|
} else {
|
||||||
|
$soacontact = $contact
|
||||||
|
}
|
||||||
|
|
||||||
file { "${dns::server::chroot}${zonedir}/db.${zonefile}":
|
file { "${dns::server::chroot}${zonedir}/db.${zonefile}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
content => template("dns/db.erb"),
|
content => template("dns/db.erb"),
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
$TTL 3600
|
$TTL 3600
|
||||||
$ORIGIN <%= zone %>.
|
$ORIGIN <%= zone %>.
|
||||||
<% master.each_pair do |k, v| %>
|
<% master.each_pair do |k, v| %>
|
||||||
@ IN SOA <%= v['ns'] %>. hostmaster.<%= zone %>. (
|
@ IN SOA <%= v['ns'] %>. <%= soacontact %>. (
|
||||||
<%= Time.now.to_i %> ; Serial
|
<%= Time.now.to_i %> ; Serial
|
||||||
3600 ; Refresh
|
3600 ; Refresh
|
||||||
7200 ; Retry
|
7200 ; Retry
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue