Skip to content

Commit

Permalink
Merge pull request #195 from jcpunk/wtmp-rhel9
Browse files Browse the repository at this point in the history
Update defaults to match RHEL8/9
  • Loading branch information
ekohl authored Jul 13, 2022
2 parents 53f422e + dab1462 commit ae480a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@
$configdir = '/etc'
$root_group = 'root'
$logrotate_bin = '/usr/sbin/logrotate'

$wtmp_missingok = versioncmp($facts['os']['release']['major'],'8') >= 0
$base_rules = {
'wtmp' => {
path => '/var/log/wtmp',
missingok => false,
missingok => $wtmp_missingok,
create_mode => '0664',
minsize => '1M',
},
Expand Down
8 changes: 6 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
"7",
"8",
"9"
]
},
{
Expand All @@ -50,7 +52,9 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
"7",
"8",
"9"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/defaults_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
is_expected.to contain_logrotate__rule('wtmp').with(
'path' => '/var/log/wtmp',
'create_mode' => '0664',
'missingok' => false,
'missingok' => facts[:operatingsystemmajrelease].to_i >= 8,
'minsize' => '1M',
'create' => true,
'create_owner' => 'root',
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/rule_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@
end
let(:facts) do
{
os: { family: 'RedHat' },
os: { family: 'RedHat', release: { major: '7' } },
operatingsystemmajrelease: 7
}
end
Expand Down

0 comments on commit ae480a5

Please sign in to comment.