Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
# The forward option
# @param forwarders
# The forwarders option
# @param listen_on
# The listen-on option
# @param listen_on_v6
# The listen-on-v6 option
# @param recursion
Expand Down Expand Up @@ -159,6 +161,7 @@
Variant[Enum['unmanaged'], Stdlib::Absolutepath] $defaultzonepath = $dns::params::defaultzonepath,
Optional[Enum['only', 'first']] $forward = undef,
Array[Dns::Forwarder] $forwarders = [],
Optional[String] $listen_on = undef,
Variant[String, Boolean] $listen_on_v6 = 'any',
Enum['yes', 'no'] $recursion = 'yes',
Array[String] $allow_recursion = ['localnets', 'localhost'],
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/dns_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@
end
end

describe 'with ipv4 disabled' do
let(:params) { {:listen_on => 'none'} }

it { verify_concat_fragment_contents(catalogue, 'options.conf+10-main.dns', [
'listen-on { none; };',
])}
end

describe 'with ipv6 disabled' do
let(:params) { {:listen_on_v6 => 'none'} }

Expand Down
3 changes: 3 additions & 0 deletions templates/options.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ empty-zones-enable <%= scope.lookupvar('::dns::empty_zones_enable') %>;
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('::dns::dns_notify')) -%>
notify <%= scope.lookupvar('::dns::dns_notify') %>;
<% end -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('::dns::listen_on')) -%>
listen-on { <%= scope.lookupvar('::dns::listen_on') %>; };
<% end -%>
<% unless [false, nil, :undefined, :undef, ''].include?(scope.lookupvar('::dns::listen_on_v6')) -%>
listen-on-v6 { <%= scope.lookupvar('::dns::listen_on_v6') %>; };
<% end -%>
Expand Down
Loading