Resource Type: cleanup
- Defined in:
- lib/puppet/type/cleanup.rb
Overview
This type allows you to specify files to cleanup at the end of the Puppet run.
You don’t need to be very careful where you place the cleanup, because the cleanup will only be done when all of the Puppet run processing has been done.
This is an ideal replacement for all of the ‘exec { ’/bin/rm -f xxx:}‘ resources you had before.
Here is an example on how to use it:
cleanup { '/tmp/temporary_files':}
This will cleanup (== remove) all files in the directory ‘/tmp/tempoirary_files`.
You can use the cleanup resource both for individual files and directories. When you specify a directory; the directory including any subdirectories will be removed.