aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystems/resolver.pp
blob: 2ad0cd48d945450d3dc588021f94e03071102a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class resolver($nameservers = hiera('nodo::resolver::nameservers', '')) {
  # DNS resolver
  case $nameservers {
    '': {
      package { 'resolvconf':
        ensure => present,
      }

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