diff --git a/manifests/init.pp b/manifests/init.pp index 6ce600b..c8b8092 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,6 +21,7 @@ Boolean $preserve_mods = true, Boolean $correct_escapes = true, Boolean $manage_logpath = true, + Boolean $manage_logrotate = $freeradius::params::manage_logrotate, Optional[String] $package_ensure = 'installed', String $radacctdir = $freeradius::params::radacctdir, String $snmp_traps_enable = 'disable', @@ -471,37 +472,39 @@ } } - logrotate::rule { 'radacct': - path => "${freeradius::fr_logpath}/radacct/*/*.log", - rotate_every => 'day', - rotate => 7, - create => false, - missingok => true, - compress => true, - postrotate => "kill -HUP `cat ${freeradius::fr_pidfile}`", - sharedscripts => true, - } - - logrotate::rule { 'checkrad': - path => "${freeradius::fr_logpath}/checkrad.log", - rotate_every => 'week', - rotate => 1, - create => true, - missingok => true, - compress => true, - postrotate => "kill -HUP `cat ${freeradius::fr_pidfile}`", - sharedscripts => true, - } - - logrotate::rule { 'radiusd': - path => "${freeradius::fr_logpath}/radius*.log", - rotate_every => 'week', - rotate => 26, - create => true, - missingok => true, - compress => true, - postrotate => "kill -HUP `cat ${freeradius::fr_pidfile}`", - sharedscripts => true, + if $manage_logrotate { + logrotate::rule { 'radacct': + path => "${freeradius::fr_logpath}/radacct/*/*.log", + rotate_every => 'day', + rotate => 7, + create => false, + missingok => true, + compress => true, + postrotate => "kill -HUP `cat ${freeradius::fr_pidfile}`", + sharedscripts => true, + } + + logrotate::rule { 'checkrad': + path => "${freeradius::fr_logpath}/checkrad.log", + rotate_every => 'week', + rotate => 1, + create => true, + missingok => true, + compress => true, + postrotate => "kill -HUP `cat ${freeradius::fr_pidfile}`", + sharedscripts => true, + } + + logrotate::rule { 'radiusd': + path => "${freeradius::fr_logpath}/radius*.log", + rotate_every => 'week', + rotate => 26, + create => true, + missingok => true, + compress => true, + postrotate => "kill -HUP `cat ${freeradius::fr_pidfile}`", + sharedscripts => true, + } } # Placeholder resource for dh and random as they are dynamically generated, so they diff --git a/manifests/params.pp b/manifests/params.pp index c584c77..c4e7ef8 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -188,4 +188,9 @@ # Default radsniff pid file location $fr_radsniff_pidfile = "/var/run/${fr_service}/radsniff.pid" + + $manage_logrotate = $::osfamily ? { + 'Debian' => false, + default => true, + } }