Skip to content
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

Support RHEL9, Debian11 and Ubuntu 22.04 #87

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Default value: `true`

Data type: `Boolean`

use Net::INET6Glue
use Net::INET6Glue , parameter is ignored on RedHat 9 and newer.

Default value: `false`

Expand Down
8 changes: 7 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@
) {
assert_private()

if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'9') >= 0 {
$_inet6glue = false
} else {
$_inet6glue = $inet6glue
}

file { "/etc/${pkgname}.conf":
ensure => file,
content => epp('fetchcrl/fetch-crl.conf.epp', {
'agingtolerance' => $agingtolerance,
'nosymlinks' => $nosymlinks,
'inet6glue' => $inet6glue,
'inet6glue' => $_inet6glue,
'nowarnings' => $nowarnings,
'noerrors' => $noerrors,
'http_proxy' => $http_proxy,
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# Do not create serial number symlinks.
#
# @param inet6glue
# use Net::INET6Glue
# use Net::INET6Glue , parameter is ignored on RedHat 9 and newer.
#
# @param noerrors
# Do not produce errors.
Expand Down
8 changes: 7 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
) {
assert_private()

if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'9') >= 0 {
$_inet6glue = false
} else {
$_inet6glue = $inet6glue
}

# The fetch-crl package.
if $inet6glue {
if $_inet6glue {
$inet6glue_pkg = $facts['os']['family'] ? {
'Debian' => 'libnet-inet6glue-perl',
'RedHat' => 'perl-Net-INET6Glue',
Expand Down
12 changes: 8 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,32 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"10"
"10",
"11"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"18.04",
"20.04"
"20.04",
"22.04"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7",
"8"
"8",
"9"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8"
"8",
"9"
]
}
]
Expand Down
16 changes: 14 additions & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,22 @@
it { is_expected.to contain_package('libnet-inet6glue-perl').with_ensure('present') }
else
it { is_expected.to contain_yumrepo('carepo') }
it { is_expected.to contain_package('perl-Net-INET6Glue').with_ensure('present') }

case facts[:os]['release']['major']
when '7', '8'
it { is_expected.to contain_package('perl-Net-INET6Glue').with_ensure('present') }
else
it { is_expected.not_to contain_package('perl-Net-INET6Glue') }
end
end
it { is_expected.to contain_file('/etc/fetch-crl.conf').with_content(%r{^noerrors$}) }
it { is_expected.to contain_file('/etc/fetch-crl.conf').with_content(%r{^inet6glue$}) }

case [facts[:os]['name'], facts[:os]['release']['major']]
when %w[RedHat 7], %w[CentOS 7], %w[RedHat 8], %w[CentOS 8], %w[Debian 10], %w[Debian 11], ['Ubuntu', '18.04'], ['Ubuntu', '20.04'], ['Ubuntu', '22.04']
it { is_expected.to contain_file('/etc/fetch-crl.conf').with_content(%r{^inet6glue$}) }
else
it { is_expected.not_to contain_file('/etc/fetch-crl.conf').with_content(%r{^inet6glue$}) }
end

case [facts[:os]['name'], facts[:os]['release']['major']]
when %w[RedHat 7], %w[CentOS 7], %w[Debian 10], ['Ubuntu', '18.04']
Expand Down