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

Update BLS kernel options on EL >= 9.3 #98

Merged
merged 2 commits into from
Jul 9, 2024
Merged
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
22 changes: 21 additions & 1 deletion lib/puppet/provider/kernel_parameter/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,28 @@ def self.mkconfig_path

confine exists: mkconfig_path, for_binary: true

# Add BLS specific option to mkconfig command if needed
#
# @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

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

def mkconfig
execute(self.class.mkconfig_path, { failonfail: true, combine: false })
execute(self.class.mkconfig_cmdline, { failonfail: true, combine: false })
end

# when both grub* providers match, prefer GRUB 2
Expand Down