clemenko / rke_airgap_install

a script/method for air gapping the Rancher Stack with Hauler
47 stars 25 forks source link

EL Version Variable Does Not Work In Oracle Linux #8

Closed ruppmeister closed 11 months ago

ruppmeister commented 11 months ago

I am running OL 8.7 currently. In finding the variable for EL version, the output for release version of rpm returns 6 instead of the expected 8.

In looking further into the issue, the command setting the variable for el version is looking to rpm package version which has an output containing a minor version number, which in this case is the 6.

# rpm -q rpm
rpm-4.14.3-24.el8_6.x86_64

To correct for the minor version number being used to grab needed rpms, I wrote the line to set the variable a little different and it should work for other distros too.

# el version
export EL=$(rpm -q --queryformat '%{RELEASE}' rpm | grep -o "el[[:digit:]]")

Getting the value the new way might not work as the distro number reaches a double digit like 10 and above, but that is a future problem I guess.

clemenko commented 11 months ago

Give me a few days to look at this.