Open jhoblitt opened 1 year ago
@bastelfreak @jsosic @vfoucault @treydock @alexjfisher @pseiler - It looks like you have all touched the chkconfig
provider. Does anyone have an idea why self.class.all[name][:path]
would be failing on EL9?
Aww.
~ $ docker run -ti almalinux:8 alternatives --list
ld auto /usr/bin/ld.bfd
libnssckbi.so.x86_64 auto /usr/lib64/pkcs11/p11-kit-trust.so
python auto /usr/libexec/no-python
~ $ docker run -ti almalinux:9 alternatives --list
ld auto /usr/bin/ld.bfd
libnssckbi.so.x86_64 auto /usr/lib64/pkcs11/p11-kit-trust.so
Still, it seems like the provider should fail with a more useful error message?
That error message is a common problem and yeah makes it tough to debug. I remember it from https://github.com/puppetlabs/puppetlabs-docker/issues/749 too.
I think this is because of all files in lib/puppet/provider/*/{chkconfig,dpkg}.rb.
Debian started a more modern implementation of (update-)alternatives. But chkconfig also provided an implementation. But it seems on RHEL9 basically RedHat also switched to the dpkg implementation. So we need to implement conditional statements into the *.rb files which I'm not able to do so at the moment. So starting with RHEL9 we should enable dpkg.rb instead of chkconfig.rb for RedHat systems. It's always in the first lines of code.
I was able to get it working on EL9 with the chkconfig provider. The root cause of the breakage was that EL9 doesn't have a python alternative entry by default. This snippet got it to work:
if versioncmp($facts['os']['release']['major'],'8') >= 0 {
package { 'python3': }
-> alternatives { 'python':
path => '/usr/bin/python3',
}
}
if versioncmp($facts['os']['release']['major'],'9') >= 0 {
alternative_entry {'/usr/bin/python3':
ensure => present,
altlink => '/usr/bin/python',
altname => 'python',
priority => 30,
}
-> Alternatives['python']
}
However, I believe this is still a valid bug as the provider shouldn't be throwing a stack trace for what is probably a common mis-configuration.
Constraining the dpkg
provider to work on EL9 might be a little tricky, as EL9 doesn't include chkconfig
in the base package set, it still has a package for it.
I suppose we could try to do it by version strings EL8:
[root@49a3153f2133 /]# /usr/sbin/alternatives --version
alternatives version 1.19.1
EL9:
[root@1df906319d3c /]# /usr/sbin/alternatives --version
alternatives version 1.20
However, the EL9 /usr/sbin/alternatives
does not seem to have the --get-selections
flag used in the dpkg
provider.
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
The above code snippet works fine on EL8 under beaker but is producing an error on EL9.