From 4ebf1e19b370a8071ec2e00f7d3a3703e4985e0e Mon Sep 17 00:00:00 2001 From: othalla Date: Mon, 29 Apr 2019 18:14:38 +0200 Subject: [PATCH] zone allow auto plugin --- manifests/zone.pp | 7 +++++++ templates/Corefile.erb | 7 +++++++ 2 files changed, 14 insertions(+) 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 -%>