-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update defaults to match RHEL8/9 #195
Conversation
@@ -717,7 +717,7 @@ | |||
end | |||
let(:facts) do | |||
{ | |||
os: { family: 'RedHat' }, | |||
os: { family: 'RedHat', release: { major: '7' } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should really port this to rspec-puppet-facts soonish
Thanks for the PR. Can you please add CentOS 8/9 to metadata.json? |
Done |
can you please take a look at the failing tests? |
I have no idea why these tests are failing.... there is something amiss with the OS detection code but that is beyond me.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems complicated, how about
$wtmp_missingok = versioncmp($facts['os']['release']['major'],'7')) <= 0 ? {
true => false,
default => true,
}
and no need to create duplicate resource definition?
Updated with the suggested form. |
I honestly don't see how these changes are suddenly making the self tests fail the group ownership or file ensures.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Rebased following latest module sync |
The failures I'm showing are part of the existing failure set. |
manifests/params.pp
Outdated
$wtmp_missingok = versioncmp($facts['os']['release']['major'],'7') <= 0 ? { | ||
true => false, | ||
default => true, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this equivalent?
$wtmp_missingok = versioncmp($facts['os']['release']['major'],'7') <= 0 ? { | |
true => false, | |
default => true, | |
} | |
$wtmp_missingok = versioncmp($facts['os']['release']['major'],'8') >= 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
spec/classes/defaults_spec.rb
Outdated
if facts[:operatingsystemmajrelease].to_i <= 7 | ||
it { | ||
is_expected.to contain_logrotate__rule('wtmp').with( | ||
'path' => '/var/log/wtmp', | ||
'create_mode' => '0664', | ||
'missingok' => false, | ||
'minsize' => '1M', | ||
'create' => true, | ||
'create_owner' => 'root', | ||
'create_group' => 'utmp', | ||
'rotate' => 1, | ||
'rotate_every' => 'monthly' | ||
) | ||
} | ||
else | ||
it { | ||
is_expected.to contain_logrotate__rule('wtmp').with( | ||
'path' => '/var/log/wtmp', | ||
'create_mode' => '0664', | ||
'missingok' => true, | ||
'minsize' => '1M', | ||
'create' => true, | ||
'create_owner' => 'root', | ||
'create_group' => 'utmp', | ||
'rotate' => 1, | ||
'rotate_every' => 'monthly' | ||
) | ||
} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than duplicating it, thoughts on the following (where I didn't bother with correctly indenting):
if facts[:operatingsystemmajrelease].to_i <= 7 | |
it { | |
is_expected.to contain_logrotate__rule('wtmp').with( | |
'path' => '/var/log/wtmp', | |
'create_mode' => '0664', | |
'missingok' => false, | |
'minsize' => '1M', | |
'create' => true, | |
'create_owner' => 'root', | |
'create_group' => 'utmp', | |
'rotate' => 1, | |
'rotate_every' => 'monthly' | |
) | |
} | |
else | |
it { | |
is_expected.to contain_logrotate__rule('wtmp').with( | |
'path' => '/var/log/wtmp', | |
'create_mode' => '0664', | |
'missingok' => true, | |
'minsize' => '1M', | |
'create' => true, | |
'create_owner' => 'root', | |
'create_group' => 'utmp', | |
'rotate' => 1, | |
'rotate_every' => 'monthly' | |
) | |
} | |
end | |
it do | |
is_expected.to contain_logrotate__rule('wtmp').with( | |
'path' => '/var/log/wtmp', | |
'create_mode' => '0664', | |
'missingok' => facts[:operatingsystemmajrelease].to_i >= 8, | |
'minsize' => '1M', | |
'create' => true, | |
'create_owner' => 'root', | |
'create_group' => 'utmp', | |
'rotate' => 1, | |
'rotate_every' => 'monthly' | |
) | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Pull Request (PR) description
RHEL8 and later use a slightly different default for
wtmp
This Pull Request (PR) fixes the following issues
N/A