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 RedHat-based distro 8 & 9 #240

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

$server_package = $facts['os']['release']['major'] ? {
# RHEL 6 and 7 provide Gluster packages natively
/(6|7)/ => 'glusterfs-server',
/(6|7|8|9)/ => 'glusterfs-server',
default => false
}
$client_package = $facts['os']['release']['major'] ? {
/(6|7)/ => 'glusterfs-fuse',
/(6|7|8|9)/ => 'glusterfs-fuse',
default => false,
}

Expand Down
39 changes: 37 additions & 2 deletions manifests/repo/yum.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,50 @@
}
}

case $facts['os']['name'] {
'RedHat': {
if $facts['os']['release']['major'] == '8' {
exec { 'Enabling Codeready-Builder repo':
command => 'dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms',
path => ['/usr/bin', '/usr/sbin',],
unless => 'rpm -qa | grep -c python3-pyxattr',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a yum/dnf user, but that does not look like the right way to check if a given repository is enabled.

}
}
}

'Rocky', 'CentOS', 'AlmaLinux': {
if $facts['os']['release']['major'] == '8' {
exec { 'Enabling PowerTools repo':
command => 'dnf config-manager --set-enabled powertools',
path => ['/usr/bin', '/usr/sbin',],
unless => 'rpm -qa | grep -c python3-pyxattr',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

}
}
}
}

case $facts['os']['family'] {
'RedHat': {
$sig_mirror = $facts['os']['release']['major'] ? {
'8' => 'centos.org/centos/8-stream',
'9' => 'stream.centos.org/SIGs/9-stream',
default => "centos.org/centos/${facts['os']['release']['major']}"
Comment on lines +61 to +63
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style:

Suggested change
'8' => 'centos.org/centos/8-stream',
'9' => 'stream.centos.org/SIGs/9-stream',
default => "centos.org/centos/${facts['os']['release']['major']}"
'8' => 'centos.org/centos/8-stream',
'9' => 'stream.centos.org/SIGs/9-stream',
default => "centos.org/centos/${facts['os']['release']['major']}"

}
}
default: {
$sig_mirror = "centos.org/centos/${facts['os']['release']['major']}"
}
}

$_release = if versioncmp($release, '4.1') <= 0 {
$release
} else {
$release[0]
$release.scanf('%d')[0]
}

yumrepo { "glusterfs-${facts['os']['architecture']}":
enabled => 1,
baseurl => "http://mirror.centos.org/centos/${facts['os']['release']['major']}/storage/${facts['os']['architecture']}/gluster-${_release}/",
baseurl => "http://mirror.${sig_mirror}/storage/${facts['os']['architecture']}/gluster-${_release}/",
descr => "CentOS-${facts['os']['release']['major']} - Gluster ${_release}",
gpgcheck => 1,
gpgkey => $repo_key_source,
Expand Down
7 changes: 5 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
"7",
"8",
"9"
]
},
{
Expand Down