Skip to content

Commit

Permalink
Add support for zone masterfile format
Browse files Browse the repository at this point in the history
This commit adds support for the zone masterfile format in the Zone resource.
  • Loading branch information
jfroche committed Mar 6, 2024
1 parent 88b8452 commit b2a007d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifests/zone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
Expand Down Expand Up @@ -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}.")

Expand Down
17 changes: 17 additions & 0 deletions spec/defines/dns_zone_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions templates/named.zone.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,8 @@ zone "<%= @zone %>" {
<% if @_dns_notify -%>
notify <%= @_dns_notify %>;
<% end -%>
<% if @masterfile_format -%>
masterfile-format <%= @masterfile_format %>;
<% end -%>
<% end -%>
};

0 comments on commit b2a007d

Please sign in to comment.