FAQ
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.

Search Discussions

  • Jcbollinger at Apr 22, 2013 at 1:29 pm

    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedApr 19, '13 at 8:32p
activeApr 22, '13 at 1:29p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Jcbollinger: 1 post Dennis Miller: 1 post

People

Translate

site design / logo © 2022 Grokbase