Skip to content

Commit

Permalink
Fix missing su line in default logrotate.conf on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
szponek committed Nov 23, 2017
1 parent 65da0b9 commit d26759f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@
}
}
'Debian': {
$default_su_user = versioncmp($::operatingsystemmajrelease, '14.00') ? {
1 => 'root',
default => undef,
}
$default_su_group = versioncmp($::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 d26759f

Please sign in to comment.