Skip to content

Commit 4c7009f

Browse files
committed
Match Lustre client repo to specific RHEL version
Match Lustre client repo to specific RHEL version which depends on installed kernel, following table reported in https://access.redhat.com/articles/3078#RHEL7 Signed-off-by: Luca Carrogu <[email protected]>
1 parent 1e153b5 commit 4c7009f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

attributes/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
if node['platform_version'].split('.')[1] >= '7'
213213
# Lustre Client for Centos >= 7.7
214214
default['cfncluster']['lustre']['public_key'] = 'https://fsx-lustre-client-repo-public-keys.s3.amazonaws.com/fsx-rpm-public-key.asc'
215-
default['cfncluster']['lustre']['base_url'] = "https://fsx-lustre-client-repo.s3.amazonaws.com/el/7.#{node['platform_version'].split('.')[1]}/x86_64/"
215+
default['cfncluster']['lustre']['base_url'] = "https://fsx-lustre-client-repo.s3.amazonaws.com/el/7.#{get_rhel_kernel_minor_version}/x86_64/"
216216
elsif node['platform_version'].split('.')[1] == '6'
217217
# Lustre Drivers for Centos 7.6
218218
default['cfncluster']['lustre']['version'] = '2.10.6'

libraries/helpers.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,3 +307,19 @@ def aws_domain
307307
def platform_supports_pmix?
308308
node['platform'] != 'centos' || node['platform_version'].to_i > 6
309309
end
310+
311+
#
312+
# Retrieve RHEL kernel minor version from running kernel
313+
# The minor version is retrieved from the patch version of the running kernel
314+
# following the mapping reported here https://access.redhat.com/articles/3078#RHEL7
315+
# Method works for minor version >=7
316+
#
317+
def get_rhel_kernel_minor_version
318+
# kernel release is in the form 3.10.0-1127.8.2.el7.x86_64
319+
kernel_patch_version = node['kernel']['release'].match(/^\d+\.\d+\.\d+-(\d+)\..*$/)[1]
320+
kernel_minor_version = '7'
321+
if kernel_patch_version >= '1127'
322+
kernel_minor_version = '8'
323+
end
324+
kernel_minor_version
325+
end

0 commit comments

Comments
 (0)