commit e73be39b0f3af227b8c176d8397f14628b69354a
Author: Marc Schaer <marc110191@gmail.com>
Date:   Fri Jul 31 17:21:52 2015 +0200

    Added options possibilities

diff --git a/manifests/init.pp b/manifests/init.pp
index 6b40024..ab07546 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -12,12 +12,20 @@ class dns(
   $localzonepath        = $::dns::params::localzonepath,
   $forwarders           = $::dns::params::forwarders,
   $listen_on_v6         = $::dns::params::listen_on_v6,
+  $recursion            = $::dns::params::recursion,
   $allow_recursion      = $::dns::params::allow_recursion,
+  $allow_query          = $::dns::params::allow_query,
+  $dnssec_enable        = $::dns::params::dnssec_enable,
+  $dnssec_validation    = $::dns::params::dnssec_validation,
   $namedconf_template   = $::dns::params::namedconf_template,
   $optionsconf_template = $::dns::params::optionsconf_template,
 ) inherits dns::params {
   validate_array($dns::forwarders)
   validate_array($dns::allow_recursion)
+  validate_array($dns::allow_query)
+  validate_re($dns::recursion, '^(yes|no)$', 'Only \'yes\' and \'no\' are valid values for recursion field')
+  validate_re($dns::dnssec_enable, '^(yes|no)$', 'Only \'yes\' and \'no\' are valid values for dnssec_enable field')
+  validate_re($dns::dnssec_validation, '^(yes|no|auto)$', 'Only \'yes\', \'no\' and \'auto\' are valid values for dnssec_validation field')
 
   class { '::dns::install': } ~>
   class { '::dns::config': } ~>
diff --git a/manifests/params.pp b/manifests/params.pp
index e64b712..87f2599 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -57,5 +57,10 @@ class dns::params {
 
     $listen_on_v6         = 'any'
 
+    $recursion            = 'yes'
     $allow_recursion      = []
+    $allow_query          = [ 'any' ]
+
+    $dnssec_enable        = 'yes'
+    $dnssec_validation    = 'yes'
 }
diff --git a/manifests/zone.pp b/manifests/zone.pp
index 6b29737..cfed61b 100644
--- a/manifests/zone.pp
+++ b/manifests/zone.pp
@@ -16,10 +16,14 @@ define dns::zone (
     $contact        = "root.${title}.",
     $zonefilepath   = $::dns::zonefilepath,
     $filename       = "db.${title}",
+    $manage_file    = true,
+    $forward        = 'first',
+    $forwarders     = [],
 ) {
 
-  validate_bool($reverse)
-  validate_array($masters, $allow_transfer)
+  validate_bool($reverse, $manage_file)
+  validate_array($masters, $allow_transfer, $forwarders)
+  validate_re($forward, '^(first|only)$', 'Only \'first\' or \'only\' are valid values for forward field')
 
   $zonefilename = "${zonefilepath}/${filename}"
 
@@ -29,13 +33,15 @@ define dns::zone (
     order   => "10-${zone}",
   }
 
-  file { $zonefilename:
-    ensure  => file,
-    owner   => $dns::user,
-    group   => $dns::group,
-    mode    => '0644',
-    content => template('dns/zone.header.erb'),
-    replace => false,
-    notify  => Service[$::dns::namedservicename],
+  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],
+    }
   }
 }
diff --git a/templates/named.zone.erb b/templates/named.zone.erb
index cf2ec92..8af04f5 100644
--- a/templates/named.zone.erb
+++ b/templates/named.zone.erb
@@ -1,6 +1,11 @@
 zone "<%= @zone %>" {
     type <%= @zonetype %>;
+<% if @zonetype == 'forward' -%>
+    forward <%= @forward %>;
+<% end -%>
+<% if @manage_file == true -%>
     file "<%= @zonefilename %>";
+<% end -%>
 <% if @zonetype == 'master' -%>
     update-policy {
             grant rndc-key zonesub ANY;
@@ -12,4 +17,7 @@ zone "<%= @zone %>" {
 <% unless @masters.empty? -%>
     masters { <%= @masters.join('; ') %>; };
 <% end -%>
+<% unless @forwarders.empty? -%>
+    forwarders { <%= @forwarders.join('; ') %>; };
+<% end -%>
 };
diff --git a/templates/options.conf.erb b/templates/options.conf.erb
index cbec404..0a41ebf 100644
--- a/templates/options.conf.erb
+++ b/templates/options.conf.erb
@@ -3,6 +3,11 @@ directory "<%= scope.lookupvar('::dns::vardir') %>";
 forwarders { <%= scope.lookupvar('::dns::forwarders').join("; ") %>; };
 <% end -%>
 
+recursion <%= scope.lookupvar('::dns::recursion') %>;
+allow-query { <%= scope.lookupvar('::dns::allow_query').join("; ") %>; };
+dnssec-enable <%= scope.lookupvar('::dns::dnssec_enable') %>;
+dnssec-validation <%= scope.lookupvar('::dns::dnssec_validation') %>;
+
 listen-on-v6 { <%= scope.lookupvar('::dns::listen_on_v6') %>; };
 
 <% unless scope.lookupvar('::dns::allow_recursion').empty? -%>
