This has turned into a bit of an interesting adventure in the syntax of Tidy.
Environment: puppet 0.24.8 on Fedora Core 11
After each run, I touch /tmp/foodir/bar to have something to tidy.
Test code:
# Environment Setup
$testdir = "/tmp/foodir"
$subdir = "$testdir/subdir"
file { "$testdir":
ensure => ''directory'',
require => Tidy["$testdir"]
}
file { "$subdir":
ensure => ''directory''
}
file { "$subdir/foo":
ensure => ''file'',
content => "foo"
}
file { "$testdir/foolink":
ensure => "$subdir/foo"
}
Test 1:
tidy { "$testdir":
age => ''0s'',
matches => "*"
}
Test 1 Result: Fail, bar remains
Test 2:
tidy { "$testdir":
age => ''0s'',
matches => ".*"
}
Test 2 Result: Fail, bar remains
Test 3:
tidy { "$testdir":
age => ''0s'',
recurse => ''true''
}
Test 3 Result: Pass, bar deleted
Test 4:
Created a symlink /tmp/foodir/baz that points to /tmp/foodir/subdir/foo
tidy { "$testdir":
age => ''0s'',
recurse => ''true''
}
Test 4 Result: Partial, bar deleted, baz remains
Test 5:
Created the symlink baz and touched bar
tidy { "$testdir":
age => ''0s'',
recurse => ''true'',
type => ''mtime''
}
Test 5 Result: Pass
Comments:
I don''t quite understand why the pass/fail combinations work above. I
also noticed that any subdirectory that is explicitly managed will not
be recursed into even if recurse is set to ''true''. I believe
that it
should recurse through all subdirectories, not just the ones that
aren''t otherwise managed.
Thanks,
Trevor
On Fri, Jul 24, 2009 at 00:21, Greg<greg.boug@gmail.com>
wrote:>
> Trevor,
>
> Not sure - the docs don''t seem to reference symlinks in terms of
> tidy...
>
> Just something to try - does setting rmdirs => true make any
> difference?
>
> Greg
>
> On Jul 24, 11:19 am, Trevor Vaughan <peiriann...@gmail.com> wrote:
>> So, I have a directory of symlinks that I''m managing and Tidy
doesn''t
>> seem to be doing much for me in there.
>>
>> Does Tidy ignore symlinks for some reason?
>>
>> If not, does anyone have the correct syntax?
>>
>> Thanks,
>>
>> Trevor
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---