Giter Club home page Giter Club logo

Comments (6)

traylenator avatar traylenator commented on June 24, 2024

Workaround:

   exec{'jdk8':
      command => '/usr/bin/alternatives  --set java java-1.8.0-openjdk.x86_64',
      unless  => '/usr/bin/readlink /etc/alternatives/java | /usr/bin/grep -q /java-1.8.0-openjdk-1.8.0'
    }

from puppet-alternatives.

tuxmaster5000 avatar tuxmaster5000 commented on June 24, 2024

Are there any news?

from puppet-alternatives.

sharumpe avatar sharumpe commented on June 24, 2024

Just hit this as well. Upvote, FWIW.

from puppet-alternatives.

sharumpe avatar sharumpe commented on June 24, 2024

Just added a PR to simply remove the validation line. Don't know that there's a great solution to also looking at "families", but I haven't dug into the alternatives system much. A quick look appears that the "family" thing is not a term mentioned in the man pages. But as the OP and I have discovered, it does seem to work for the JDK, at least.

I'm able to use update-alternatives --set java java-latest-openjdk.x86_64 successfully, and with the code change, I can use this in the manifest:

  alternatives { 'java':
    mode => 'manual',
    path => 'java-latest-openjdk.x86_64',
  }

from puppet-alternatives.

sharumpe avatar sharumpe commented on June 24, 2024

...and, as with all things, it turned out not to be that simple, of course. :D
Since my setup doesn't need to have multiple jdk's installed, I'm going to punt, but it would be great if this could work. I'll look at it more as I get time, but for now, my PR just results in puppet setting the alternative every run, which is obviously not desired.

from puppet-alternatives.

tkriener avatar tkriener commented on June 24, 2024

Would be great if this could be fixed.

Here is a workaround for Java 11 under RHEL 7:

alternative_entry {'/usr/lib/jvm/jre-11-openjdk/bin/java':
    ensure   => present,
    altlink  => '/usr/bin/java',
    altname  => 'java',
    priority => 999999,
    require  => Package['java-11-openjdk-headless'],
}

alternatives { 'java':
  path    => '/usr/lib/jvm/jre-11-openjdk/bin/java',
  require => Alternative_entry['/usr/lib/jvm/jre-11-openjdk/bin/java'],
}

This adds an entry with a static path using the already available link under /usr/lib/jvm

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.