aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystems/resolver.pp
blob: a6604f5d5d13870a6cda34c8d6527e76a963dad0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class resolver(
  $manage      = hiera('nodo::resolver::manage',      false),
  $nameservers = hiera('nodo::resolver::nameservers', '')
  $domain      = hiera('nodo::resolver::domain',      $::domain),
  $search      = hiera('nodo::resolver::search',      $::fqdn)
) {
  # DNS resolver
  case $manage {
    true: {
      package { 'resolvconf':
        ensure => present,
      }

      file { '/etc/resolv.conf':
        ensure  => '/etc/resolvconf/run/resolv.conf',
        require => Package['resolvconf'],
      }
    }
    default: {
      class { 'resolvconf':
        domain      => $domain,
        search      => $search,
        nameservers => $nameservers,
      }
    }
  }
}