I am trying to install the kernel-devel
package matching the running kernel version.
My guess was:
package { 'kernel-devel':
ensure => "${facts['kernelrelease']}",
}
but it doesn't work if more than one kernel-devel
package are already installed. This is the error I get:
Error: Could not update: Failed to update to version 3.10.0-957.21.3.el7.x86_64, got version 3.10.0-957.21.3.el7; 3.10.0-1062.4.3.el7; 3.10.0-1062.9.1.el7 instead
So the package is already installed, but the Package class raises an error because (apparently) it performs a string comparison instead of looking in the versions list.
What is the proper way to handle this?