LEFT | RIGHT |
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 # |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 subscribe => File['/usr/local/bin/mimeo.py'], | 77 subscribe => File['/usr/local/bin/mimeo.py'], |
78 } | 78 } |
79 | 79 |
80 exec {'reload-mimeo-daemon': | 80 exec {'reload-mimeo-daemon': |
81 notify => Service['mimeo'], | 81 notify => Service['mimeo'], |
82 command => 'systemctl daemon-reload', | 82 command => 'systemctl daemon-reload', |
83 subscribe => File['/etc/systemd/system/mimeo.service'], | 83 subscribe => File['/etc/systemd/system/mimeo.service'], |
84 refreshonly => true, | 84 refreshonly => true, |
85 } | 85 } |
86 | 86 |
87 ensure_resource('logrotate::config', 'mimeo_data', merge({ | 87 # https://docs.puppet.com/puppet/latest/types/file.html#file-attribute-source |
88 content => join([ | 88 $default_content = $rotation['source'] ? { |
| 89 undef => join([ |
89 '/var/adblockplus/mimeo/data {', | 90 '/var/adblockplus/mimeo/data {', |
90 ' weekly', | 91 ' weekly', |
91 ' rotate 30', | 92 ' rotate 30', |
92 ' compress', | 93 ' compress', |
93 ' missingok', | 94 ' missingok', |
94 ' nodateext', | 95 ' nodateext', |
95 '}', | 96 '}', |
96 ], "\n"), | 97 ], "\n"), |
| 98 default => undef, |
| 99 } |
| 100 |
| 101 ensure_resource('logrotate::config', 'mimeo_data', merge({ |
| 102 content => $default_content, |
97 ensure => 'present', | 103 ensure => 'present', |
98 }, $rotation)) | 104 }, $rotation)) |
99 } | 105 } |
100 | 106 |
LEFT | RIGHT |