Project

General

Profile

Download (1.36 KB) Statistics
| Branch: | Tag: | Revision:
401c2875 Ivan Nečas
# Define new zone for the dns
5d340dbb Ewoud Kohl van Wijngaarden
define dns::zone (
aa274696 Ewoud Kohl van Wijngaarden
$zonetype = 'master',
$soa = $::fqdn,
$reverse = false,
$ttl = '10800',
$soaip = $::ipaddress,
$refresh = 86400,
$update_retry = 3600,
$expire = 604800,
$negttl = 3600,
$serial = 1,
$masters = [],
63902e07 Trey Dockendorf
$allow_transfer = [],
fd3d862b Warren Clarke
$also_notify = [],
aa274696 Ewoud Kohl van Wijngaarden
$zone = $title,
$contact = "root.${title}.",
$zonefilepath = $::dns::zonefilepath,
$filename = "db.${title}",
e73be39b Marc Schaer
$manage_file = true,
$forward = 'first',
$forwarders = [],
5d340dbb Ewoud Kohl van Wijngaarden
) {

e73be39b Marc Schaer
validate_bool($reverse, $manage_file)
fd3d862b Warren Clarke
validate_array($masters, $allow_transfer, $forwarders, $also_notify)
e73be39b Marc Schaer
validate_re($forward, '^(first|only)$', 'Only \'first\' or \'only\' are valid values for forward field')
63902e07 Trey Dockendorf
aa274696 Ewoud Kohl van Wijngaarden
$zonefilename = "${zonefilepath}/${filename}"
17794329 Greg Sutcliffe
b132780f Dominic Cleal
concat::fragment { "dns_zones+10_${zone}.dns":
target => $::dns::publicviewpath,
79167403 Ewoud Kohl van Wijngaarden
content => template('dns/named.zone.erb'),
b132780f Dominic Cleal
order => "10-${zone}",
e1338843 Greg Sutcliffe
}
7e9f8e11 Ewoud Kohl van Wijngaarden
e73be39b Marc Schaer
if $manage_file {
file { $zonefilename:
ensure => file,
owner => $dns::user,
group => $dns::group,
mode => '0644',
content => template('dns/zone.header.erb'),
replace => false,
notify => Service[$::dns::namedservicename],
}
17794329 Greg Sutcliffe
}
}