From 17f0ee77d3cb53505d772747e935f96595036dfa Mon Sep 17 00:00:00 2001
From: Karl Kornel <akkornel@stanford.edu>
Date: Mon, 22 Jun 2015 15:52:44 -0700
Subject: [PATCH] dns: Add support for NOT managing resolv.conf

This is important for systems using Puppet and DHCP, because DHCP renewals
rewrite resolv.conf, which then gets re-re-written by Puppet.
---
 NEWS             |  3 +++
 manifests/dns.pp | 11 +++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 3de022d..320cbe7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 unreleased (??)
 
+    [dns] Add support for disabling Puppet management of resolv.conf, for 
+    systems using DHCP (akkornel)
+
     [remctl] Require remctl-server package be installed before installing 
     xinetd config (akkornel)
 
diff --git a/manifests/dns.pp b/manifests/dns.pp
index c38e518..51752a5 100644
--- a/manifests/dns.pp
+++ b/manifests/dns.pp
@@ -1,5 +1,12 @@
 # Defines the DNS configuration of a system.
 
-class base::dns {
-  base::dns::resolv_conf { $::fqdn_lc: ensure => present }
+# 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".
+class base::dns(
+  $no_resolv_conf = false
+) {
+  if !$no_resolv_conf {
+    base::dns::resolv_conf { $::fqdn_lc: ensure => present }
+  }
 }
-- 
GitLab