saltstack-formulas / salter

Salter orchestrates software profiles onto Linux/MacOS/FreeBSD/Windows without fuss.
Apache License 2.0
6 stars 5 forks source link

[suse, centos, bsd] kernel package check is wrong #44

Closed noelmcloughlin closed 4 years ago

noelmcloughlin commented 5 years ago

If linux kernel is upgraded and no reboot happens there can be issues: https://github.com/saltstack-formulas/docker-formula/issues/203 so flagging the need for a reboot is important.

However the check for package linux- is incorrect on suse/centos:

kernel before: 4.12.14-lp150.12.22-default
^[[Ckernel after: Loading repository data...
Warning: Repository 'openSUSE Non-OSS Update' appears to be outdated. Consider using a different mirror or server.
Reading installed packages...

S  | Name               | Type    | Version            | Arch   | Repository         
---+--------------------+---------+--------------------+--------+--------------------
i+ | libselinux1        | package | 2.6-lp150.3.3.1    | x86_64 | openSUSE OSS Update
i+ | util-linux         | package | 2.31.1-lp150.7.6.1 | x86_64 | openSUSE OSS Update
i+ | util-linux-systemd | package | 2.31.1-lp150.7.6.1 | x86_64 | openSUSE OSS Update
Reboot if kernel was major-upgraded; if unsure reboot!

The correct package name there is kernel-xxxxx

vagrant@vagrant-openSUSE-Leap:~/bob> rpm -qa | grep kernel-
kernel-default-4.12.14-lp150.12.70.1.x86_64
noelmcloughlin commented 5 years ago

Same issue on FreeBSD

kernel before: 11.2-RELEASE...
kernel after: 
Reboot if kernel was major-upgraded; if unsure reboot!
noelmcloughlin commented 4 years ago

Fixed on MacOS and FreeBSD

kernel before: 11.3-RELEASE...
kernel after: 11.3-RELEASE
Reboot if kernel was major-upgraded; if unsure reboot!