Hi All.... I''ve got this configuration to manage bind, I want the exec to be run whenever anything under /var/named or the file /etc/named.conf gets updated.... file { "/etc/named.conf": owner => root, group => root, mode => 0644, require => Package["bind"], source => "puppet:///dnsauth/etc/named.conf", } file { "/var/named": owner => named, group => named, mode => 0644, require => File["/etc/named.root.hints"], source => "puppet:///dnsauth/var/named", recurse => true, force => true, ignore => ".svn", purge => true, } exec { "/etc/init.d/named reload": subscribe => [ File["/var/named"], File["/etc/named.conf"] ], command => "/etc/init.d/named reload", refreshonly => true, } Currently, if I modify /etc/named.conf the exec runs as expected, but if I modify a file under /var/named it never gets run and nothing is logged, but the file is pushed out ok. Any ideas how to get this to work, we''d rather not add every single file{} entry for everything under /var/named TIA Craig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
2009/3/25 Craig Dunn <lists@codenation.net>> > Hi All.... > > I''ve got this configuration to manage bind, I want the exec to be run > whenever anything under /var/named or the file /etc/named.conf gets > updated.... > > file { "/etc/named.conf": > owner => root, > group => root, > mode => 0644, > require => Package["bind"], > source => "puppet:///dnsauth/etc/named.conf", > } > file { "/var/named": > owner => named, > group => named, > mode => 0644, > require => File["/etc/named.root.hints"], > source => "puppet:///dnsauth/var/named", > recurse => true, > force => true, > ignore => ".svn", > purge => true, > } >I''d try to change the /var/named to this:- file { "/var/named": ensure => directory, notify => Exec["/etc/init.d/named reload"], owner => named, group => named, mode => 0644, require => File["/etc/named.root.hints"], source => "puppet:///dnsauth/var/named", recurse => true, force => true, ignore => ".svn", purge => true, } and remove the subscribes from the Exec HTH Gary -- Gary Law --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
> I''d try to change the /var/named to this:- > > file { "/var/named": > ensure => directory, > notify => Exec["/etc/init.d/named reload"], > owner => named, > group => named, > mode => 0644, > require => File["/etc/named.root.hints"], > source => "puppet:///dnsauth/var/named", > recurse => true, > force => true, > ignore => ".svn", > purge => true, > } > > and remove the subscribes from the Exec > > HTH > > Gary > >Hi, This didn''t have any effect - still the same... heres the debug I get after modifying a zone file under /var/named/zones, you''ll see it pushes the file out but never actually attempts to run the code... # puppetd --verbose --no-daemonize --debug -o Reopening log files Compiled catalog for puppet in 0.17 seconds Caching catalog at /var/lib/puppet/localconfig.yaml Starting catalog run (//Node[dev-mgmt]/dnsauth/File[/var/named/zones]/checksum) checksum changed ''{mtime}Wed Mar 25 14:03:37 +0000 2009'' to ''{mtime}Wed Mar 25 14:14:12 +0000 2009'' (Filebucket[/var/lib/puppet/clientbucket]) Adding /var/named/zones/hosts.domain.co.uk.db(a1782f4546b5e3073361c4492b20fa0b) (//Node[dev-mgmt]/dnsauth/File[/var/named/zones/hosts.domain.co.uk.db]) Filebucketed to puppet with sum a1782f4546b5e3073361c4492b20fa0b (//Node[dev-mgmt]/dnsauth/File[/var/named/zones/hosts.domain.co.uk.db]/source) replacing from source puppet:///dnsauth/var/named/zones/hosts.domain.co.uk.db with contents {md5}39a30e0190fa590180ff857a0a896c9c Compiled catalog for host091.network.domain.co.uk in 0.10 seconds (//Node[dev-mgmt]/dnsauth/File[/var/named/data]/checksum) checksum changed ''{mtime}Wed Mar 25 14:06:09 +0000 2009'' to ''{mtime}Wed Mar 25 14:14:14 +0000 2009'' Finished catalog run in 8.42 seconds Cheers Craig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
The following, which is very similar to what you posted, works for me in so far as it triggers the Exec if a subdirectory of /var/named is created, if a new file is created in the subdir, or if an existing file is modified in the subdir: class rectest { exec { "/etc/init.d/named reload": command => "/etc/init.d/named reload", refreshonly => true, } file { "/var/named": notify => Exec["/etc/init.d/named reload"], ensure => directory, owner => glaw, group => glaw, mode => 0644, source => "puppet://sv01.garylaw.net/rectest/var/named", recurse => true, force => true, ignore => ".svn", purge => true, } } -- Gary Law --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Dennis Miller
2013-Apr-19 20:21 UTC
Re: [Puppet Users] Re: Subscribe to a recursive file...
This doesn''t seem to work for me in THIS specific case: -editing the file directly under /var/named Adding a new file works fine, but editing an existing one doesn''t trigger the exec. I think the directory mtime doesn''t change, and Puppet doesn''t know that a change has happened. Thoughts? On Wednesday, March 25, 2009 7:44:10 PM UTC-5, Gary Law wrote:> > The following, which is very similar to what you posted, works for me in > so far as it triggers the Exec if a subdirectory of /var/named is created, > if a new file is created in the subdir, or if an existing file is modified > in the subdir: > > class rectest { > exec { "/etc/init.d/named reload": > command => "/etc/init.d/named reload", > refreshonly => true, > } > > file { "/var/named": > notify => Exec["/etc/init.d/named reload"], > ensure => directory, > owner => glaw, > group => glaw, > mode => 0644, > source => "puppet://sv01.garylaw.net/rectest/var/named", > recurse => true, > force => true, > ignore => ".svn", > purge => true, > } > } > > > > -- > Gary Law > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On Friday, April 19, 2013 3:21:26 PM UTC-5, Dennis Miller wrote:> > This doesn''t seem to work for me in THIS specific case: > > -editing the file directly under /var/named > > Adding a new file works fine, but editing an existing one doesn''t trigger > the exec. I think the directory mtime doesn''t change, and Puppet doesn''t > know that a change has happened. Thoughts? > >I think Puppet''s File type is not up to this task in recursive directory form, at least not without a bit of help. That could perhaps be characterized as a bug (so consider filing a ticket), but then again, the whole recursive file thing has always been ... let''s say "quirky". Dennis''s observation suggests a possible workaround: always ''touch'' the top-level directory on the master after making changes to its contents. If it has subdirectories then you might need to do the same with them. Alternatively, are there so many files, or are files added and removed frequently enough, that it would be prohibitive to manage each explicitly? Recursive directory management should be viewed as a shortcut. If it doesn''t get you to where you need to be, however, then you may just need to abandon it. Here''s a crazy idea: I think it would be possible to write a pair of definitions that automate the procedure of declaring bona fide File resources for all the files in a directory tree. You would use the generate() function to get a (full) listing of the target directory, and massage it into a hash of hashes that you can use with create_resources(). I surely make it sound simpler than it really is, but I think it''s doable. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.