}
if $ptr {
- $subnet = inline_template("<%= host.split('.')[0,3].join('.') %>")
- $number = inline_template("<%= host.split('.')[3] %>")
+ $arpa = inline_template("<%= require 'ipaddr'; IPAddr.new(host).reverse %>")
+ $arpa_zone = inline_template("<%= require 'ipaddr'; IPAddr.new(host).reverse.split('.')[1..-1].join('.') %>")
- bind::ptr {$host:
+ bind::ptr {"${arpa}.":
ensure => $ensure,
- zone => $subnet,
+ zone => $arpa_zone,
host => $name,
ttl => $ttl,
}
*$zone_ns*: Valid NS for this zone (master only)
*$zone_xfers*: IPs. Valid xfers for zone (master only)
*$zone_masters*: IPs. Valid master for this zone (slave only)
+ *$zone_origin*: The origin of the zone
*/
define bind::zone($ensure=present,
$zone_expiracy="1w",
$zone_ns=false,
$zone_xfers=false,
- $zone_masters=false) {
+ $zone_masters=false,
+ $zone_origin=false) {
common::concatfilepart {"bind.zones.${name}":
ensure => $ensure,
content => template("bind/zone-master.erb"),
}
- common::concatfilepart {"bind.00.${name}":
+ common::concatfilepart {"00.bind.${name}":
ensure => $ensure,
file => "/etc/bind/pri/${name}.conf",
content => template("bind/zone-header.erb"),
; File managed by puppet
$TTL <%=zone_ttl%>
+<% if zone_origin -%>
+$ORIGIN <%=zone_origin%>
+<% end -%>
@ IN SOA <%=name%>. <%=zone_contact%>. (
<%=zone_serial%> ; serial
<%=zone_refresh%> ; refresh