Skip to content
Snippets Groups Projects
dns.pp 1.08 KiB
Newer Older
Adam Lewenberg's avatar
Adam Lewenberg committed
# Defines the DNS configuration of a system.

# You may set $no_resolv_conf to prevent Puppet from overriding the system's
# resolv.conf file.  This is helpful in DHCP environments.
# To enable, use Hiera to set base::dns::no_resolv_conf to "true".
# If you use a DNS cache, you can change base::dns::dns_cache in Hiera to
# true, and 127.0.0.1 will be set as the first nameserver.
# If the system's primary interface's IP address is in a known Livermore
# network, then the Livermore DNS will be added above the standard DNS servers.
# If dns_cache is also true, the Livermore DNS server will be second (right
# below 127.0.0.1).
class base::dns(
  $no_resolv_conf = false,
  $dns_cache      = 'NONE',

  # Check if we are in Livermore, based on IP address
  if (   ip_in_cidr($::ipaddress, '204.63.224.0/21')
      or ip_in_cidr($::ipaddress, '172.20.224.0/21')
  ) {
    $livermore = true
  } else {
    $livermore = false
  }

    base::dns::resolv_conf { $::fqdn_lc:
      ensure    => present,
      dns_cache => $dns_cache,
      livermore => $livermore,
    }
Adam Lewenberg's avatar
Adam Lewenberg committed
}