Skip to content
Snippets Groups Projects
Commit 597fd251 authored by Karl Kornel's avatar Karl Kornel
Browse files

dns: Determine Livermore presence based on IP, not parameter

We know the three large IP address blocks that exist in Livermore, and we now
have an ip_in_cidr() function, so we are using that to tell if a system is in
Livermore.

This code will need updating only if the large network blocks in Livermore are
changed.
parent 26fb3198
No related branches found
No related tags found
No related merge requests found
Unreleased
[dns] Changes Livermore detection to use the system's primary IP address,
instead of using a manually-set parameter. (akkornel)
release/004.053 (2015-07-28)
......
......@@ -7,14 +7,24 @@
# 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.
# For Livermore sites, change base::dns::livermore to true, and the Livermore
# DNS server will be added above the standard DNS servers. If dns_cache is
# also true, Livermore DNS will be second (right below 127.0.0.1).
# 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',
$livermore = false,
) {
# 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
}
if !$no_resolv_conf {
base::dns::resolv_conf { $::fqdn_lc:
ensure => present,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment