Skip to content

Loading…

Add support for Ubuntu 14.04 LTS #32

Open
wants to merge 1 commit into from

5 participants

@blkperl

No description provided.

@jchonig

I'm also having this issue and looked at the provided patch.

The fix of making a template out of logrotate.conf.erb looks good.

It might be more general to put tests in the os-specific classes (logrotate::defaults::debian for example) for OS versions that use the new version of logrotate.

Thoughts from rodjek?

Thanks.

Jeff

@wolfspyre wolfspyre pushed a commit to wolfspyre/puppet-logrotate that referenced this pull request
@rmnwolf rmnwolf [EOPS-6067] manually add in fixes from rodjek#32 af0b6f9
@rodjek rodjek commented on the diff
templates/etc/logrotate.conf.erb
@@ -5,6 +5,12 @@
# rotate log files weekly
weekly
+<% if @lsbmajdistrelease and (scope.function_versioncmp([@lsbmajdistrelease, '14']) >= 0) -%>
@rodjek Owner
rodjek added a note

You should also check lsbdistid to ensure that this only applies to Ubuntu > 14.

@blkperl
blkperl added a note

Why do I need to check both?

@blkperl
blkperl added a note

@rodjek Ping

@jchonig
jchonig added a note

You want to check both to insure that this change doesn't happen on distros other than Ubuntu. I.e. this would incorrectly be applied to Fedora releases > 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@b4ldr b4ldr referenced this pull request
Closed

Add su line to logrotate.conf #47

@luxflux

Whats the state here?

@benjfield

Looks good, I too have this issue and I am currently having to use this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2014
  1. @blkperl
View
2 manifests/base.pp
@@ -18,7 +18,7 @@
'/etc/logrotate.conf':
ensure => file,
mode => '0444',
- source => 'puppet:///modules/logrotate/etc/logrotate.conf';
+ content => template('logrotate/etc/logrotate.conf.erb');
'/etc/logrotate.d':
ensure => directory,
mode => '0755';
View
2 spec/classes/base_spec.rb
@@ -9,7 +9,7 @@
'owner' => 'root',
'group' => 'root',
'mode' => '0444',
- 'source' => 'puppet:///modules/logrotate/etc/logrotate.conf',
+ 'content' => /# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET. ANY CHANGES WILL BE/,
'require' => 'Package[logrotate]',
})
View
6 files/etc/logrotate.conf → templates/etc/logrotate.conf.erb
@@ -5,6 +5,12 @@
# rotate log files weekly
weekly
+<% if @lsbmajdistrelease and (scope.function_versioncmp([@lsbmajdistrelease, '14']) >= 0) -%>
@rodjek Owner
rodjek added a note

You should also check lsbdistid to ensure that this only applies to Ubuntu > 14.

@blkperl
blkperl added a note

Why do I need to check both?

@blkperl
blkperl added a note

@rodjek Ping

@jchonig
jchonig added a note

You want to check both to insure that this change doesn't happen on distros other than Ubuntu. I.e. this would incorrectly be applied to Fedora releases > 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+# use the syslog group by default, since this is the owning group
+# # of /var/log/syslog.
+su root syslog
+<%- end -%>
+
# keep 4 weeks worth of backlogs
rotate 4
Something went wrong with that request. Please try again.