Giter VIP home page Giter VIP logo

Comments (9)

jsosic avatar jsosic commented on September 24, 2024

On 12.04 update-alternatives is distributed with dpkg. Don't have 14.04 so don't know if something changed there?

# dpkg -L dpkg | egrep 'bin.*alternatives'
/usr/bin/update-alternatives
/usr/sbin/update-alternatives

so basically alternatives are available with deb based distros out of the box.

from puppet-alternatives.

jurgenweber avatar jurgenweber commented on September 24, 2024

no, sorry. My explanation is not clear. It is the same in the two OS as in the package but I mean when it runs it gives an error. I mean as in, when you try to update the alternatives there are no alternatives available for Ruby in 14.04.... it is just 1.9.3 so it reports an error.

I will recreate it tonight and post with the error.

from puppet-alternatives.

jsosic avatar jsosic commented on September 24, 2024

Please do so before I decide to spent time on bringing up test env on ubuntu 14.04.

from puppet-alternatives.

jurgenweber avatar jurgenweber commented on September 24, 2024

So with the error from a vagrant machine:

Notice: /Stage[main]/Puppetmaster/Exec[update-alternatives --set gem /usr/bin/gem1.9.1]/returns: update-alternatives: error: no alternatives for gem
Error: update-alternatives --set gem /usr/bin/gem1.9.1 returned 2 instead of one of [0]
Error: /Stage[main]/Puppetmaster/Exec[update-alternatives --set gem /usr/bin/gem1.9.1]/returns: change from notrun to 0 failed: update-alternatives --set gem /usr/bin/gem1.9.1 returned 2 instead of one of [0]
Notice: /Stage[main]/Puppetmaster/Exec[update-alternatives --set ruby /usr/bin/ruby1.9.1]/returns: update-alternatives: error: no alternatives for ruby
Error: update-alternatives --set ruby /usr/bin/ruby1.9.1 returned 2 instead of one of [0]
Error: /Stage[main]/Puppetmaster/Exec[update-alternatives --set ruby /usr/bin/ruby1.9.1]/returns: change from notrun to 0 failed: update-alternatives --set ruby /usr/bin/ruby1.9.1 returned 2 instead of one of [0]

so if you could validate if the thing in this case ruby actually has an alternative before running that would be awesome.

from puppet-alternatives.

jsosic avatar jsosic commented on September 24, 2024

Can you provide me with code that generates these errors? ty

from puppet-alternatives.

jurgenweber avatar jurgenweber commented on September 24, 2024

holy shit. I am not even using your module for this (it's vagrant puppet run up, so I use minimal modules) and I did not think of it. I just assumed. I do use your module else where thou.

  exec { 'update-alternatives --set ruby /usr/bin/ruby1.9.1':
    unless  => 'test /etc/alternatives/ruby -ef /usr/bin/ruby1.9.1',
    path    => '/usr/bin:/usr/sbin',
    require => Package['ruby1.9.1-full'],
  }
  exec { 'update-alternatives --set gem /usr/bin/gem1.9.1':
    unless  => 'test /etc/alternatives/gem -ef /usr/bin/gem1.9.1',
    path    => '/usr/bin:/usr/sbin',
    require => Package['ruby1.9.1-full'],
  }

Apologies for the trouble/wrong assumption.

from puppet-alternatives.

jsosic avatar jsosic commented on September 24, 2024

No problem I like the bugs that resolve themselves out :)

from puppet-alternatives.

jurgenweber avatar jurgenweber commented on September 24, 2024

haha, yeah but now I feel like an idiot.

Enjoy your day. :)

from puppet-alternatives.

jurgenweber avatar jurgenweber commented on September 24, 2024

I now have a real world example:

==> tools01: Error: Execution of '/usr/sbin/update-alternatives --set gem /usr/bin/gem1.9.1' returned 2: update-alternatives: error: no alternatives for gem
==> tools01: Error: /Stage[main]/Profile_puppet/Alternatives[gem]/path: change from  to /usr/bin/gem1.9.1 failed: Execution of '/usr/sbin/update-alternatives --set gem /usr/bin/gem1.9.1' returned 2: update-alternatives: error: no alternatives for gem
==> tools01: Error: Execution of '/usr/sbin/update-alternatives --set ruby /usr/bin/ruby1.9.1' returned 2: update-alternatives: error: no alternatives for ruby
==> tools01: Error: /Stage[main]/Profile_puppet/Alternatives[ruby]/path: change from  to /usr/bin/ruby1.9.1 failed: Execution of '/usr/sbin/update-alternatives --set ruby /usr/bin/ruby1.9.1' returned 2: update-alternatives: error: no alternatives for ruby

and the puppet code:

  ensure_resource('alternatives', 'ruby', {
    path     => '/usr/bin/ruby1.9.1',
    require  => Class['ruby'],
  })
  ensure_resource('alternatives', 'gem', {
    path     => '/usr/bin/gem1.9.1',
    require  => Class['ruby'],
  })

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.