puppet-archive
puppet-archive copied to clipboard
Ability to purge the target directory
The archive::extract
resource from camptocamp/archive contains a purge
parameter which can be used to purge the contents of the target directory when extracting an archive. It seems that this module doesn't have a purge
parameter. I can work around this by doing the following, but it would obviously be much cleaner if the archive
type provided a purge
parameter:
exec { "rm -rf ${extract_path}":
refreshonly => true,
before => File[$extract_path],
subscribe => File[$archive_path],
}
file { $extract_path:
ensure => 'directory',
mode => '0755',
}
archive { $archive_path:
creates => "${extract_path}/some_path",
extract => true,
extract_path => $extract_path,
subscribe => File[$archive_path],
}