]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/nova/manifests/cron/archive_deleted_rows.pp
b8335462e54fa743d817bf81d2ac8c3f5db915ba
[dsa-puppet.git] / 3rdparty / modules / nova / manifests / cron / archive_deleted_rows.pp
1 #
2 # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
3 #
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
16 # under the License.
17 #
18 # == Class: nova::cron::archive_deleted_rows
19 #
20 # Move deleted instances to another table that you don't have to backup
21 # unless you have data retention policies.
22 #
23 # === Parameters
24 #
25 #  [*minute*]
26 #    (optional) Defaults to '1'.
27 #
28 #  [*hour*]
29 #    (optional) Defaults to '0'.
30 #
31 #  [*monthday*]
32 #    (optional) Defaults to '*'.
33 #
34 #  [*month*]
35 #    (optional) Defaults to '*'.
36 #
37 #  [*weekday*]
38 #    (optional) Defaults to '*'.
39 #
40 #  [*max_rows*]
41 #    (optional) Maximum number of deleted rows to archive.
42 #    Defaults to '100'.
43 #
44 #  [*user*]
45 #    (optional) User with access to nova files.
46 #    Defaults to 'nova'.
47 #
48 class nova::cron::archive_deleted_rows (
49   $minute   = 1,
50   $hour     = 0,
51   $monthday = '*',
52   $month    = '*',
53   $weekday  = '*',
54   $max_rows = '100',
55   $user     = 'nova',
56 ) {
57
58   cron { 'nova-manage db archive_deleted_rows':
59     command     => "nova-manage db archive_deleted_rows --max_rows ${max_rows} >>/var/log/nova/nova-rowsflush.log 2>&1",
60     environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
61     user        => $user,
62     minute      => $minute,
63     hour        => $hour,
64     monthday    => $monthday,
65     month       => $month,
66     weekday     => $weekday,
67     require     => Package['nova-common'],
68   }
69 }