Showing with 36 additions and 12 deletions.
  1. +14 −0 CHANGELOG.md
  2. +1 −1 README.md
  3. +1 −1 manifests/params.pp
  4. +1 −1 manifests/zone.pp
  5. +1 −1 metadata.json
  6. +15 −8 spec/classes/dns_init_spec.rb
  7. +3 −0 templates/named.conf.erb
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [9.5.0](https://github.com/theforeman/puppet-dns/tree/9.5.0) (2022-10-28)

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

**Implemented enhancements:**

- stopped zone file from being created if zone type is forward [\#219](https://github.com/theforeman/puppet-dns/pull/219) ([ikonia](https://github.com/ikonia))
- Remove dnssec-enable option for EL \>= 9 [\#218](https://github.com/theforeman/puppet-dns/pull/218) ([ikonia](https://github.com/ikonia))
- Added defaultzonepath to template name.conf.erb [\#217](https://github.com/theforeman/puppet-dns/pull/217) ([benjamin-robertson](https://github.com/benjamin-robertson))

**Merged pull requests:**

- Change IRC support details for foreman website support URL [\#222](https://github.com/theforeman/puppet-dns/pull/222) ([ikonia](https://github.com/ikonia))

## [9.4.0](https://github.com/theforeman/puppet-dns/tree/9.4.0) (2022-08-01)

[Full Changelog](https://github.com/theforeman/puppet-dns/compare/9.3.0...9.4.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ See the CONTRIBUTING.md file for much more information.
# More info
See [https://theforeman.org](https://theforeman.org) or at #theforeman irc channel on freenode
See [https://theforeman.org](https://theforeman.org) and [https://theforeman.org/support.html](https://theforeman.org/support.html) for support
Copyright (c) 2010-2016 Foreman developers and Zach Leslie
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# This option is not relevant for RedHat
$sysconfig_resolvconf_integration = undef

$dnssec_enable = 'yes'
$dnssec_enable = if versioncmp($facts['os']['release']['major'], '9') >= 0 { undef } else { 'yes' }
}
/^(FreeBSD|DragonFly)$/: {
$dnsdir = '/usr/local/etc/namedb'
Expand Down
2 changes: 1 addition & 1 deletion manifests/zone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
}
}

if $manage_file {
if ($manage_file and $zonetype !='forward') {
file { $zonefilename:
ensure => file,
owner => $dns::user,
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": "9.4.0",
"version": "9.5.0",
"author": "theforeman",
"summary": "Manage the ISC BIND daemon",
"license": "Apache-2.0",
Expand Down
23 changes: 15 additions & 8 deletions spec/classes/dns_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
end
end

let(:defaultzonepath) do
case facts[:os]['family']
when 'Debian'
"#{etc_directory}/named.conf.default-zones"
end
end

let(:var_path) do
case facts[:os]['family']
when 'Debian'
Expand Down Expand Up @@ -104,7 +111,7 @@
when 'Debian'
['9', '10', '18.04'].include?(facts[:os]['release']['major'])
when 'RedHat'
true
['7', '8'].include?(facts[:os]['release']['major'])
else
false
end
Expand Down Expand Up @@ -139,14 +146,11 @@
'options {',
" include \"#{options_path}\";",
'};',
"include \"#{localzonepath}\";",
localzonepath ? "include \"#{localzonepath}\";" : nil,
defaultzonepath ? "include \"#{defaultzonepath}\";" : nil,
'// Public view read by Server Admin',
"include \"#{etc_named_directory}/zones.conf\";",
]

unless localzonepath
expected = expected.reject { |line| line == 'include "";' }
end
].compact

verify_concat_fragment_exact_contents(catalogue, 'named.conf+10-main.dns', expected)
end
Expand All @@ -164,10 +168,11 @@
it { is_expected.not_to contain_concat_fragment('named.conf+60-logging-footer.dns') }
end

describe 'with unmanaged localzonepath' do
describe 'with unmanaged localzonepath and unmanaged defaultzonepath' do

let(:params) do {
:localzonepath => 'unmanaged',
:defaultzonepath => 'unmanaged',
} end

it { verify_concat_fragment_exact_contents(catalogue, 'named.conf+10-main.dns', [
Expand Down Expand Up @@ -217,6 +222,7 @@
" include \"#{options_path}\";",
'};',
localzonepath ? "include \"#{localzonepath}\";" : nil,
defaultzonepath ? "include \"#{defaultzonepath}\";" : nil,
'// additional directives',
'logging {',
' channel string {',
Expand All @@ -236,6 +242,7 @@
"include \"#{etc_named_directory}/zones.conf\";",
].compact


verify_concat_fragment_exact_contents(catalogue, 'named.conf+10-main.dns', expected)
end
end
Expand Down
3 changes: 3 additions & 0 deletions templates/named.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ options {
<% if scope.lookupvar("::dns::localzonepath") != 'unmanaged' -%>
include "<%= scope.lookupvar('::dns::localzonepath') %>";
<% end -%>
<% if scope.lookupvar("::dns::defaultzonepath") != 'unmanaged' -%>
include "<%= scope.lookupvar('::dns::defaultzonepath') %>";
<% end -%>
<% end -%>
<%- scope.lookupvar('::dns::acls').sort_by {|k, v| k}.each do |acl_name, acl_array| -%>
Expand Down