christian hofstaedtler
Puppet: managing directories recursively

This is not very obvious from Puppet's TypeReference, but you can manage directories in a very interesting way:

Still not very interesting, but please see the light:
This yields, very effectively, a fully managed directory with lots of flexibility.
We're using this approach for all sorts of configuration directories, including:
For this to work, you need to do a little bit of work:
Because puppet looks for those file resources which manage a sub-dir of the managed directory it is also possible to define a sub-directory with unmanaged files, which will then not get removed - no magic involved here:
file { "/etc/exim4/conf.d/acl":
  ensure => directory,
  owner => "root",
  group => "root",
  mode => 0755,
}