Skip to content

Commit

Permalink
Merge pull request #92 from szponek/fix-default-logrotate-conf-on-ubuntu
Browse files Browse the repository at this point in the history
Fix missing su line in default logrotate.conf on Ubuntu
  • Loading branch information
bastelfreak authored Nov 26, 2017
2 parents 65da0b9 + 208fe2d commit 63ced8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@
}
}
'Debian': {
$default_su_group = versioncmp($::operatingsystemmajrelease, '14.00') ? {
$default_su_user = versioncmp($facts['operatingsystemmajrelease'], '14.00') ? {
1 => 'root',
default => undef,
}
$default_su_group = versioncmp($facts['operatingsystemmajrelease'], '14.00') ? {
1 => 'syslog',
default => undef
}
$conf_params = {
su_user => $default_su_user,
su_group => $default_su_group,
}
$configdir = '/etc'
Expand Down
10 changes: 8 additions & 2 deletions spec/classes/defaults_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@

if facts[:operatingsystem] == 'Ubuntu' && facts[:operatingsystemmajrelease].to_i >= 14
it {
is_expected.to contain_logrotate__conf('/etc/logrotate.conf').with_su_group('syslog')
is_expected.to contain_logrotate__conf('/etc/logrotate.conf').with(
'su_user' => 'root',
'su_group' => 'syslog'
)
}
else
it {
is_expected.to contain_logrotate__conf('/etc/logrotate.conf').with_su_group(nil)
is_expected.to contain_logrotate__conf('/etc/logrotate.conf').with(
'su_user' => nil,
'su_group' => nil
)
}
end
it {
Expand Down

0 comments on commit 63ced8e

Please sign in to comment.