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? -- Dan Urist durist@ucar.edu 303-497-2459 -- 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.
On 09/28/2010 06:17 PM, 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 not sure this is how subscribe is supposed to work. Try changing - owner - group - mode of your directory prior to the puppet run. That should trigger the subscription. Also, remove the entire dir. Seeing as puppet is not managing contents, I don''t think adding a file or otherwise chaging the checksum will trigger subscriptions. As to how you can make this work in the general case, I have no idea. Cheers, Felix> 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? >-- 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.
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-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.