f05258db2427567d19aca819358b31041cb04db4
[mirror/dsa-puppet.git] / 3rdparty / modules / glance / manifests / cache / cleaner.pp
1 # == Class: glance::cache::cleaner
2 #
3 # Installs a cron job to run glance-cache-cleaner.
4 #
5 # === Parameters
6 #
7 #  [*minute*]
8 #    (optional) Defaults to '1'.
9 #
10 #  [*hour*]
11 #    (optional) Defaults to '0'.
12 #
13 #  [*monthday*]
14 #    (optional) Defaults to '*'.
15 #
16 #  [*month*]
17 #    (optional) Defaults to '*'.
18 #
19 #  [*weekday*]
20 #    (optional) Defaults to '*'.
21 #
22 #  [*command_options*]
23 #    command options to add to the cronjob
24 #    (eg. point to config file, or redirect output)
25 #    (optional) Defaults to ''.
26 #
27 class glance::cache::cleaner (
28   $minute           = 1,
29   $hour             = 0,
30   $monthday         = '*',
31   $month            = '*',
32   $weekday          = '*',
33   $command_options  = '',
34 ) {
35
36   include glance::params
37
38   cron { 'glance-cache-cleaner':
39     command     => "${glance::params::cache_cleaner_command} ${command_options}",
40     environment => 'PATH=/bin:/usr/bin:/usr/sbin',
41     user        => 'glance',
42     minute      => $minute,
43     hour        => $hour,
44     monthday    => $monthday,
45     month       => $month,
46     weekday     => $weekday,
47     require     => Package[$::glance::params::api_package_name],
48   }
49 }