On Friday, October 12, 2012 10:27:11 AM UTC-5, Ygor wrote:
[...] I saw other discussions about "tidy" that mentioned the same thing, so I started tinkering. If I use mtime or ctime, directories get deleted, which is great, but it also deleted the top of the tree -- /volume/foo/bar/ in my example. I found a workaround, but I think it is ugly. That's not the behavior I would have expected from the docs, which, for one thing, use the example of tidying /tmp. You would never want to delete that. Is the behavior the same if you leave off the trailing '/' from the resource title? What if you use "matches => ['[^.]*', '.[^.]*', '..?*']" (i.e. everything except . and ..)? You shouldn't have to jump through such hoops, but I think it's clear that Puppet has some deficiencies here. It the very minimum, the documentation should be improved. <blockquote> Looking at the output, tidy must generate temporary resources to delete the files and directories. </blockquote> Yes. That's kinda strange, but documented. <blockquote> If I declare a file resource for /volume/foo/bar/ with ensure => present, the puppet run output says: info: /File[/volume/foo/bar]: Duplicate generated resource; skipping </blockquote> As it should do. Really, it is unwise anyway to use 'tidy' in a way that might affect an otherwise-managed file, but if you happen to do so then it is right for Puppet to complain instead of trying to guess which declarations represent your real intention. <blockquote> Seems like a klooodjy way to do it but...? </blockquote> I suspect the reason is exactly to catch conflicts, just as you observed it to do. But, yeah, it does seem kludgy, or at least clunky. John Good suggestion about the matches parameter. I will try it and let you know. I am fortunate in that the directory I am trying to tidy is NOT something important like "/tmp", but I share your concern. I opened a bug/issue on this before -- http://projects.puppetlabs.com/issues/15904 I think I need to add this detail to that bug. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
