3 # This class installs and configures unbound
11 $is_recursor = getfromhash($site::nodeinfo, 'misc', 'resolver-recursive')
12 $client_ranges = hiera('allow_dns_query')
13 $empty_client_range = empty($client_ranges)
14 $ns = hiera('nameservers')
26 file { '/var/lib/unbound':
30 require => Package['unbound'],
33 file { '/var/lib/unbound/root.key':
39 source => 'puppet:///modules/unbound/root.key'
41 file { '/var/lib/unbound/debian.org.key':
47 source => 'puppet:///modules/unbound/debian.org.key'
49 file { '/var/lib/unbound/29.172.in-addr.arpa.key':
55 source => 'puppet:///modules/unbound/29.172.in-addr.arpa.key'
57 file { '/etc/unbound/unbound.conf':
58 content => template('unbound/unbound.conf.erb'),
61 File['/var/lib/unbound/root.key'],
62 File['/var/lib/unbound/debian.org.key']
64 notify => Service['unbound']
67 if ($is_recursor and !$empty_client_range) {
68 @ferm::rule { 'dsa-dns':
70 description => 'Allow nameserver access',
71 rule => sprintf('&TCP_UDP_SERVICE_RANGE(53, (%s))', join_spc(filter_ipv4($client_ranges))),
73 @ferm::rule { 'dsa-dns6':
75 description => 'Allow nameserver access',
76 rule => sprintf('&TCP_UDP_SERVICE_RANGE(53, (%s))', join_spc(filter_ipv6($client_ranges))),