On Sep 28, 2010, at 9:17 AM, Dan Urist wrote: > I have the following test code in a manifest: > >> file { >> '/tmp/testdir': >> ensure => directory, >> owner => root, >> group => root, >> mode => 0755, >> checksum => mtime; >> } >> >> exec { >> 'testdir_updated': >> command => 'touch /tmp/testdir_updated', >> subscribe => File['/tmp/testdir'], >> refreshonly => true; >> } > > This doesn't appear to work; i.e. if I touch /tmp/testdir or add a file > to it (which changes the mtime of the directory), the exec doesn't get > run. It runs with every puppetd invocation if I remove 'refreshonly => > true'. > > I'm using puppet v.2.6.1 on Ubuntu Lucid. I could swear this used to > work, and I thought this is/was a common technique. Am I missing > something, or is this a bug?
First, I'd like to thank Felix Frank for jogging my memory. The reason this doesn't work is because puppet doesn't remember state information. Puppet just compares the current state to the state the object "should" have. An example is that you declare that the "file" should be a directory and should have permission mode of 0755. You never declare what the mtime should be though. To declare an mtime, use the "source" parameter and set the source directory to have the correct mtime. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.