diff --git a/manifests/zone.pp b/manifests/zone.pp index df99a4cd..e8b59a1a 100644 --- a/manifests/zone.pp +++ b/manifests/zone.pp @@ -63,6 +63,8 @@ # @param auto_dnssec # @param dnssec_policy # Causes the zone to be signed and turns on automatic maintenance for the zone. +# @param masterfile_format +# The format used to load the master file # define dns::zone ( Array[String] $target_views = [], @@ -101,6 +103,7 @@ Optional[Enum['yes', 'no']] $dnssec_secure_to_insecure = undef, Optional[Enum['allow', 'maintain', 'off']] $auto_dnssec = undef, Optional[String[1]] $dnssec_policy = undef, + Optional[Enum['text', 'raw', 'map']] $masterfile_format = undef, ) { $_contact = pick($contact, "root.${zone}.") diff --git a/spec/defines/dns_zone_spec.rb b/spec/defines/dns_zone_spec.rb index 4caf4ef4..c5dd6067 100644 --- a/spec/defines/dns_zone_spec.rb +++ b/spec/defines/dns_zone_spec.rb @@ -475,6 +475,23 @@ ]) end end + + context 'zone format defined' do + let(:params) { { + :masterfile_format => 'text', + } } + + it "should have valid zone configuration" do + verify_concat_fragment_exact_contents(catalogue, 'dns_zones+10__GLOBAL__example.com.dns', [ + 'zone "example.com" {', + ' type master;', + " file \"#{zonefilepath}/db.example.com\";", + ' masterfile-format text;', + '};', + ]) + end + end + end end end diff --git a/templates/named.zone.erb b/templates/named.zone.erb index f5e046b1..38c0e16f 100644 --- a/templates/named.zone.erb +++ b/templates/named.zone.erb @@ -63,5 +63,8 @@ zone "<%= @zone %>" { <% if @_dns_notify -%> notify <%= @_dns_notify %>; <% end -%> +<% if @masterfile_format -%> + masterfile-format <%= @masterfile_format %>; +<% end -%> <% end -%> };