Skip to content

Commit

Permalink
fix: limit scope of update-bls-cmdline to RHEL9
Browse files Browse the repository at this point in the history
grub2 on Amazon/Fedora is not compatible

Co-authored-by: Vadym Chepkov <[email protected]>
Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
  • Loading branch information
vchepkov and ekohl committed Aug 20, 2024
1 parent 2f7a6d7 commit 32177e7
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions lib/puppet/provider/kernel_parameter/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,12 @@ def self.mkconfig_path
#
# @return (String) The commandline
def self.mkconfig_cmdline
needs_bls_cmdline = lambda do
os = Facter.value(:os)
return false unless os.is_a?(Hash)

return false unless os['family'] == 'RedHat'
return false if os['release']['major'].to_i < 9
return false if os['release']['major'].to_i == 9 && os['release']['minor'].to_i < 3

true
end
os = Facter.value(:os)
needs_bls_cmdline = os.is_a?(Hash) && os['family'] == 'RedHat' && !%w[Amazon Fedora].include?(os['name']) &&
os['release']['major'].to_i == 9 && os['release']['minor'].to_i >= 3

cmdline = [mkconfig_path]
cmdline << '--update-bls-cmdline' if needs_bls_cmdline.call
cmdline << '--update-bls-cmdline' if needs_bls_cmdline
cmdline
end

Expand Down

0 comments on commit 32177e7

Please sign in to comment.