theforeman / puppet-foreman_proxy

Puppet module for Foreman Smart Proxy
GNU General Public License v3.0
43 stars 130 forks source link

Simplify grub_efi_path on redhat family #804

Closed eb4x closed 1 year ago

eb4x commented 1 year ago

Remains backwards-compatible with supported distros, and we don't have to look for openeuler or oraclelinux or any other EL variant.

m-bucher commented 9 months ago

@ekohl @eb4x I must object at least in part to this PR, because I actually install foreman on OracleLinux from time to time.

I am not sure if there is a better way to fix this than just reverting this commit (which is what I currently do).

ekohl commented 9 months ago

@m-bucher I think this shouldn't break Oracle, unless the name in /etc/os-release differs from the Puppet fact name. Because that's how grub2 on Red Hat is patched: use the name from os-release (downcased) in the file path

eb4x commented 9 months ago

Unfortunately, he's right. I installed OracleLinux 8.9 on an efi vm. It's /boot/efi/EFI/redhat, because why the :cursing_face: wouldn't it be.

Would this be an ok way to write an exception for this exceptional os?

$grub_efi_path = unless $facts['os']['name'] == 'OracleLinux' {
    downcase($facts['os']['name'])
} else {
  'redhat'
}
ekohl commented 9 months ago

I would use a regular if instead of unless, but yes. This is (sadly) going to be needed

eb4x commented 9 months ago

I "reverted" back to the previous way with the case statement, with the logic swapped. #828