I am writing a site.pp to automate some tasks performed on a Windows VM puppet agent and I would like to know how to remove recursively a directory.

Am 06.04.2014 01:27, schrieb Swit Zerland:
I am writing a site.pp to automate some tasks performed on a Windows VM puppet agent and I would like to know how to remove recursively a directory.
Either use an exec, which includes an "onlyif" attribute to remove the tree with an OS command, or one file resource (with "ensure => absent") for each directory in the tree. The latter needs more wotk to set up, but has the advantage of being OS independent.
Finally, you could write a new "dirtree" module which provides a new resource for managing directory trees and make it available on Github ;)