From 99ebef5ffc4bd4dbb15e5e803544115687c59083 Mon Sep 17 00:00:00 2001
From: Adam Henry Lewenberg <adamhl@stanford.edu>
Date: Thu, 8 Oct 2015 14:55:16 -0700
Subject: [PATCH] have dnsmasq restart if /etc/resolv.conf changes

---
 manifests/dns/cache_packages.pp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/manifests/dns/cache_packages.pp b/manifests/dns/cache_packages.pp
index 7b3beca..f6e648b 100644
--- a/manifests/dns/cache_packages.pp
+++ b/manifests/dns/cache_packages.pp
@@ -33,10 +33,12 @@ class base::dns::cache_packages {
       notify  => Service['dnsmasq'],
     }
 
-    # Define the service and make sure it runs.
+    # Define the service and make sure it runs. Restart the service if
+    # /etc/resolv.conf changes.
     service { 'dnsmasq':
-      ensure  => 'running',
-      require => Package['dnsmasq'],
+      ensure    => 'running',
+      require   => Package['dnsmasq'],
+      subscribe => File['/etc/resolv.conf'],
     }
   }
 }
-- 
GitLab