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.

 

>
> Looking at the output, tidy must generate temporary resources to delete 
> the files and directories.
>


Yes.  That's kinda strange, but documented.

 

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

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.

 

> Seems like a klooodjy way to do it but...?
>
>
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

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/zc7BSohp-mEJ.
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.

Reply via email to