diff --git a/manifests/zone.pp b/manifests/zone.pp index 5fe161e..8b4b0dc 100644 --- a/manifests/zone.pp +++ b/manifests/zone.pp @@ -15,12 +15,19 @@ Boolean $forward = false, String $forward_from = '.', Optional[Array[String]] $forward_to = undef, + Optional[String] $auto = undef, + Optional[Hash] $auto_config = undef, ) { if $forward { if $forward_to == undef { fail('coredns: forward_to must be set') } } + if $auto { + if $auto_config == undef { + fail('coredns: auto_config must be set') + } + } include ::coredns concat::fragment{ "Corefile-${title}": target => "${coredns::config_dir}/Corefile", diff --git a/templates/Corefile.erb b/templates/Corefile.erb index dd60b80..ce7d6b7 100644 --- a/templates/Corefile.erb +++ b/templates/Corefile.erb @@ -18,6 +18,13 @@ <%- end %> <%- end -%> <%- end -%> +<% if @auto -%> + auto <%= @auto -%> { + <%- @auto_config.each do |key, value| -%> + <%= key %> <%= value %> + <%- end -%> + } +<%- end -%> <%- if @log -%> log <%- end -%>