On Monday, April 7, 2014 12:32:45 AM UTC-5, Dirk Heinrichs wrote:
>
>  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 ;)
>
>
Or use a Tidy resource to recursively clean out the directory, and an 
ordinary File resource with ensure => 'absent' to remove the directory.  Or 
maybe it would work to use just one File resource with ensure => 'absent', 
recurse => 'true'.


John

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0a6bfc20-813b-45b9-98bc-a8df2300eb26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to