Skip to content

Commit

Permalink
support RedHat-based distro 8 & 9
Browse files Browse the repository at this point in the history
  • Loading branch information
mcodenie committed Aug 20, 2022
1 parent bafcec3 commit 4e92246
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 6 deletions.
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
37 changes: 35 additions & 2 deletions manifests/repo/yum.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,48 @@
}
}

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',],
}
}
}

'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',],
}
}
}
}

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']}"
}
}
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

0 comments on commit 4e92246

Please sign in to comment.