Puppet Class: nginxpack::logrotate
- Defined in:
- manifests/logrotate.pp
Overview
Class: nginxpack::logrotate
Install and configure logrotate for Nginx (daily rotate vhosts logs).
Should be used through the main nginxpack class.
More explanations: forge.puppetlabs.com/jvaubourg/nginxpack Sources: github.com/jvaubourg/puppetlabs-nginxpack
Parameters
- enable
-
False to be sure that the logrotate rules for Nginx are removed. Please note that logrotate and psmisc packages will not are automatically uninstalled due to possible conflicts. Default: true
Authors
Julien Vaubourg julien.vaubourg.com
Copyright
Copyright © 2013 Julien Vaubourg
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <www.gnu.org/licenses/>.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'manifests/logrotate.pp', line 40
class nginxpack::logrotate (
$enable = true,
) {
if $enable {
ensure_packages([ 'logrotate', 'psmisc' ])
file { '/etc/logrotate.d/nginx':
ensure => file,
mode => '0644',
source => 'puppet:///modules/nginxpack/logrotate/logrotate',
require => [
Package['nginx'],
File['/var/log/nginx/'],
Package['logrotate'],
Package['psmisc'],
],
}
} else {
file { '/etc/logrotate.d/nginx':
ensure => absent,
}
}
}
|