Giter Club home page Giter Club logo

Comments (3)

westbywest avatar westbywest commented on June 28, 2024

Confirming am also affected by this problem.

  • Puppet: 4.6.2
  • Distribution: CentOS 7.3.11
  • Module version: v1.1.0

I have to call alternatives directly via exec, e.g.:

exec { 'install keytool alternatives':
  command => "/usr/sbin/alternatives --install /usr/bin/keytool keytool ${::java_default_home}/jre/bin/keytool 20000",
  unless => "/usr/sbin/alternatives --list | grep keytool",
}

from puppet-alternatives.

westbywest avatar westbywest commented on June 28, 2024

Further detail on this problem is that the first invocation of any alternative_entry{} resource triggers "Prefetching rpm resources for alternative_entry," whereby the module runs "/usr/sbin/alternatives --display ..." on all defined entries. Return value >0 on any of these instances apparently causes the entire catalog to fail. This seems unreasonably fragile.

from puppet-alternatives.

westbywest avatar westbywest commented on June 28, 2024

My recurring problem is openjdk rpm under RHEL/CentOS sometimes leaves a broken alternatives entry for keytool. My resolution is have an exec remove the broken alternatives entry prior to any alternative_entry{} resource gets declared, which is awkward.

include java

# Remove broken alternatives entry before *any* alternative_entry{} resource
exec {
  'remove broken keytool alternatives entry':
    command => "rm -rf /var/lib/alternatives/keytool",
    path    => ['/usr/bin', '/usr/sbin', '/bin'],
    onlyif => "egrep '^/usr/bin/keytool' /var/lib/alternatives/keytool",
    unless => 'test -f /usr/bin/keytool';
}
Exec['remove broken keytool alternatives entry'] -> Alternative_Entry<| |>

# Now let puppet/alternatives add the keytools entry
alternative_entry { "${::java_default_home}/jre/bin/keytool":
  ensure   => present,
  altlink  => '/usr/bin/keytool',
  altname  => 'keytool',
  priority => 20000, # This is priority set by puppetlabs/java
  require  => Class['java'],
}

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.