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

HTH...

    Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 1596666 (Ansage) 1149
*Email*: [email protected] <mailto:[email protected]>
*Skype*: dirk.heinrichs.recommind
www.recommind.com <http://www.recommind.com>



http://www.recommind.com

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5342387D.9000002%40recommind.com.
For more options, visit https://groups.google.com/d/optout.

<<inline: Logo.gif>>

Reply via email to