Giter VIP home page Giter VIP logo

Comments (7)

jhoblitt avatar jhoblitt commented on September 24, 2024

@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?

from puppet-alternatives.

jhoblitt avatar jhoblitt commented on September 24, 2024

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

from puppet-alternatives.

jhoblitt avatar jhoblitt commented on September 24, 2024

Still, it seems like the provider should fail with a more useful error message?

from puppet-alternatives.

kenyon avatar kenyon commented on September 24, 2024

That error message is a common problem and yeah makes it tough to debug. I remember it from puppetlabs/puppetlabs-docker#749 too.

from puppet-alternatives.

pseiler avatar pseiler commented on September 24, 2024

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.

from puppet-alternatives.

jhoblitt avatar jhoblitt commented on September 24, 2024

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.

from puppet-alternatives.

jhoblitt avatar jhoblitt commented on September 24, 2024

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.

from puppet-alternatives.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.