Having the file you want to retain under management, either directly or via recursive management of its directory, would be a decent direction to go, but it might not be practical. If it isn't, then there is no resource type among those shipped with Puppet that provides exactly what you want.
If files are reliably added to the target directory on a fixed schedule, however (e.g. old log files produced by logrotate), then you might be able to use the Tidy's 'age' parameter to preserve the most recent one(s).
There is also the option of writing a custom resource type to use in place of Tidy.
On the other hand, maybe it would ease the problem simply to use a cleaner command in your Exec, such as
ls -cd /dir/to/clean/* | grep 'subdir selection pattern' | sed 1d | xargs rm -rf
I guess beauty may be in the eye of the beholder, but I find that one a lot easier to read than yours. Notes:
- The -c option to ls causes the output to be sorted by ctime, from newest to oldest.
- If you need extra help to distinguish directories from ordinary files, you could add the -F option to the ls, so that a / will be appended to directory names. You could then filter out non-directories via the grep pattern (or alternatively, by a slightly longer sed program). The rm will ignore the trailing slash.
John