cleanup
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.
Attributes
Attribute Name | Short Description |
---|---|
file_name | the file name(s) of the file you want to cleanup. |
loglevel | |
name | the name of the cleanup resource. |
file_name
the file name(s) of the file you want to cleanup. If this is not specified, Puppet will use the title as the file name.
loglevel
Valid values are debug
, info
, notice
, warning
, err
, alert
, emerg
, crit
.
name
the name of the cleanup resource.