class resolver(
  $manage      = hiera('nodo::resolver::manage', false),
  $nameservers = hiera('nodo::resolver::nameservers', '')
) {
  # 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':
        search      => $::fqdn,
        nameservers => $nameservers,
      }
    }
  }
}