From a2d2316176c496a11bb520ac6a88612756483395 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 26 May 2013 16:18:30 -0300 Subject: Adding bind::view --- manifests/zone.pp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'manifests/zone.pp') diff --git a/manifests/zone.pp b/manifests/zone.pp index 1b61788..db792ae 100644 --- a/manifests/zone.pp +++ b/manifests/zone.pp @@ -27,11 +27,20 @@ define bind::zone ( $zone_ns = false, $zone_xfers = false, $zone_masters = false, - $zone_origin = false + $zone_origin = false, + $view = false ) { + $target = $view ? { + false => "/etc/bind/zones/${name}.conf", + default => "/etc/bind/views/${view}.conf", + } + concat::fragment {"named.local.zone.${name}": - ensure => $ensure, + ensure => $view ? { + false => $ensure, + default => absent, + }, target => '/etc/bind/named.conf.local', content => "include \"/etc/bind/zones/${name}.conf\";\n", notify => Service['bind9'], @@ -40,14 +49,14 @@ define bind::zone ( case $ensure { present: { - concat {"/etc/bind/zones/${name}.conf": + concat { $target: owner => root, group => root, mode => '0644', } concat::fragment {"bind.zones.${name}": ensure => $ensure, - target => "/etc/bind/zones/${name}.conf", + target => $target, notify => Service['bind9'], require => Package['bind9'], } -- cgit v1.2.3