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

Side by Side Diff: modules/adblockplus/manifests/web/mimeo.pp

Issue 29525555: #622 - Use mimeo module on abb website (Closed)
Patch Set: For comment 10 Created Aug. 24, 2017, 8:01 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/files/mimeo.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # == Class: adblockplus::web::mimeo 1 # == Class: adblockplus::web::mimeo
2 # 2 #
3 # Class adblockplus::web::mimeo registers the information received in a 3 # Class adblockplus::web::mimeo registers the information received in a
4 # http/s petition with an specified format in an specific output. 4 # http/s petition with an specified format in an specific output.
5 # 5 #
6 # === Parameters: 6 # === Parameters:
7 # 7 #
8 # [*format*] 8 # [*format*]
9 # A string containing the desired format for logging. 9 # A string containing the desired format for logging.
10 # 10 #
11 # '$remote_addr - - [$time_local] "$request" $status $bytes_sent "$http_refere r"' 11 # '$remote_addr - - [$time_local] "$request" $status $bytes_sent "$http_refere r"'
12 # 12 #
13 # [*port*] 13 # [*port*]
14 # An integer to setup the port where the script will be listening, defaults 14 # An integer to setup the port where the script will be listening, defaults
15 # to 8000. 15 # to 8000.
16 # 16 #
17 # [*response*] 17 # [*response*]
18 # A string (like format parameter) representing the response sent to the 18 # A string (like format parameter) representing the response sent to the
19 # client. 19 # client.
20 # 20 #
21 # [*rotation*]
22 # Overwrite the default log rotation configuration
23 #
21 class adblockplus::web::mimeo ( 24 class adblockplus::web::mimeo (
22 $format = '', 25 $format = '',
23 $port = 8000, 26 $port = 8000,
24 $response = '', 27 $response = '',
28 $rotation = {},
25 ){ 29 ){
26 include adblockplus 30 include adblockplus
27 31
28 ensure_packages(['python3']) 32 ensure_packages(['python3'])
29 33
30 realize(File['/var/adblockplus']) 34 realize(File['/var/adblockplus'])
31 35
32 file {'/var/adblockplus/mimeo': 36 file {'/var/adblockplus/mimeo':
33 ensure => 'directory', 37 ensure => 'directory',
34 mode => '0755', 38 mode => '0755',
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 require => Exec['enable-service-mimeo'], 76 require => Exec['enable-service-mimeo'],
73 subscribe => File['/usr/local/bin/mimeo.py'], 77 subscribe => File['/usr/local/bin/mimeo.py'],
74 } 78 }
75 79
76 exec {'reload-mimeo-daemon': 80 exec {'reload-mimeo-daemon':
77 notify => Service['mimeo'], 81 notify => Service['mimeo'],
78 command => 'systemctl daemon-reload', 82 command => 'systemctl daemon-reload',
79 subscribe => File['/etc/systemd/system/mimeo.service'], 83 subscribe => File['/etc/systemd/system/mimeo.service'],
80 refreshonly => true, 84 refreshonly => true,
81 } 85 }
86
87 # https://docs.puppet.com/puppet/latest/types/file.html#file-attribute-source
88 $default_content = $rotation['source'] ? {
89 undef => join([
90 '/var/adblockplus/mimeo/data {',
91 ' weekly',
92 ' rotate 30',
93 ' compress',
94 ' missingok',
95 ' nodateext',
96 '}',
97 ], "\n"),
98 default => undef,
99 }
100
101 ensure_resource('logrotate::config', 'mimeo_data', merge({
102 content => $default_content,
103 ensure => 'present',
104 }, $rotation))
82 } 105 }
83 106
OLDNEW
« no previous file with comments | « modules/adblockplus/files/mimeo.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld