Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/adblockplus/manifests/log/rotation.pp

Issue 29333281: Issue 3307 - Introduce class adblockplus::log::rotation (Closed)
Patch Set: Created Jan. 7, 2016, 1:14 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « modules/adblockplus/manifests/log.pp ('k') | modules/adblockplus/templates/log/rotation.erb » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # == Type: adblockplus::log::rotation
2 #
3 # Setup rotation for a particular log file.
4 #
5 # === Parameters:
6 #
7 # [*count*]
8 # How many intervals to keep rotated logs (see $interval).
9 #
10 # [*ensure*]
11 # Either 'present' or 'absent'/'purged'.
12 #
13 # [*interval*]
14 # Either 'daily', 'weekly', 'monthly', or 'yearly'.
15 #
16 # [*path*]
17 # The full path to the file to rotate, defaults to "/var/log/$name".
18 #
19 # [*postrotate*]
20 # A single command string or multiple commands in array form, to
21 # become exectued after every successful rotation.
22 #
23 # [*upload*]
24 # Whether to export the rotated *.1.gz to the $adblockplus::log::uplink.
25 #
26 # === Examples:
27 #
28 # adblockplus::log::rotation {'nginx_error_log':
29 # count => 30,
30 # ensure => 'present',
31 # interval => 'daily',
32 # path => '/var/log/nginx/error.log',
33 # postrotate => [
34 # '[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`',
35 # ],
36 # upload => true,
37 # }
38 #
39 define adblockplus::log::rotation (
40 $count = 30,
41 $ensure = 'present',
42 $interval = 'daily',
43 $path = "/var/log/$name",
44 $postrotate = [],
45 $upload = false,
46 ) {
47
48 include adblockplus::log
49 include logrotate
50
51 logrotate::config {$title:
52 content => template('adblockplus/log/rotation.erb'),
53 ensure => $ensure,
54 name => $name,
55 }
56 }
OLDNEW
« no previous file with comments | « modules/adblockplus/manifests/log.pp ('k') | modules/adblockplus/templates/log/rotation.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld