Showing with 32 additions and 1 deletion.
  1. +8 −0 CHANGELOG.md
  2. +3 −0 manifests/zone.pp
  3. +1 −1 metadata.json
  4. +17 −0 spec/defines/dns_zone_spec.rb
  5. +3 −0 templates/named.zone.erb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [10.4.0](https://github.com/theforeman/puppet-dns/tree/10.4.0) (2024-05-15)

[Full Changelog](https://github.com/theforeman/puppet-dns/compare/10.3.0...10.4.0)

**Implemented enhancements:**

- Add support for zone masterfile format [\#248](https://github.com/theforeman/puppet-dns/pull/248) ([jfroche](https://github.com/jfroche))

## [10.3.0](https://github.com/theforeman/puppet-dns/tree/10.3.0) (2024-02-19)

[Full Changelog](https://github.com/theforeman/puppet-dns/compare/10.2.0...10.3.0)
Expand Down
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
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-dns",
"version": "10.3.0",
"version": "10.4.0",
"author": "theforeman",
"summary": "Manage the ISC BIND daemon",
"license": "Apache-2.0",
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 -%>
};