Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update resolvconf on changes #48

Open
Poil opened this issue Aug 21, 2015 · 3 comments
Open

Update resolvconf on changes #48

Poil opened this issue Aug 21, 2015 · 3 comments

Comments

@Poil
Copy link

Poil commented Aug 21, 2015

Hi,

Update resolvconf on changes is not on changes, it's reloading at each puppet runs

Best regards,

@tdm4
Copy link

tdm4 commented Nov 19, 2015

Would this work?

diff --git a/modules/dnsmasq/manifests/init.pp b/modules/dnsmasq/manifests/init.pp
index 084a6a7..3ddce9a 100644
--- a/modules/dnsmasq/manifests/init.pp
+++ b/modules/dnsmasq/manifests/init.pp
@@ -57,6 +57,7 @@ class dnsmasq (
     path    => [ '/usr/bin', '/usr/sbin', '/bin', '/sbin', ],
     require => Package[$dnsmasq_package],
     before  => File[$dnsmasq_conffile],
+    notify  => Exec['reload_resolvconf'],
   }

   service { 'dnsmasq':
@@ -68,11 +69,12 @@ class dnsmasq (
   }

   exec { 'reload_resolvconf':
-    provider => shell,
-    command  => '/sbin/resolvconf -u',
-    user     => root,
-    onlyif   => 'test -f /sbin/resolvconf',
-    before   => Service['dnsmasq'],
+    provider    => shell,
+    command     => '/sbin/resolvconf -u',
+    user        => root,
+    onlyif      => 'test -f /sbin/resolvconf',
+    before      => Service['dnsmasq'],
+    refreshonly => true,
   }

   if $dnsmasq_confdir {

@tdm4
Copy link

tdm4 commented Nov 19, 2015

Thing is, I'm not 100% sure when reload_resolvconf would need to be run except if the dnsmasq config file changes?

@dje4om
Copy link

dje4om commented Mar 19, 2018

Hi,

According to this file : /etc/resolvconf/update.d/dnsmasq
It seems, it should occur only if dnsmasq.conf is updated.

Notify on concat resource for dnsmasq.conf and refreshonly => true works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants