blt04 / puppet-rvm

A puppet module for installing and using RVM (Ruby Version Manager)
Other
242 stars 280 forks source link

rvm_system_ruby exists? method #3

Closed jamtur01 closed 13 years ago

jamtur01 commented 13 years ago

I think your exists? method in rvm_system_ruby isn't supporting multiple rubies.

I have:

  rvm_system_ruby { "ruby-1.9.2-p180":
      default_use => true,
      provider => rvm_system_ruby,
      require => Exec["install rvm"],
  }

  rvm_system_ruby { "ruby-1.8.7-p334":
      provider => rvm_system_ruby,
      require => Exec["install rvm"],
  }

in a manifest. When I run the manifest one Ruby gets installed but the other returns:

debug: Rvm_system_ruby[ruby-1.8.7-p334](provider=rvm_system_ruby): Executing '/usr/local/rvm/bin/rvm list strings'

Even though:

$ /usr/local/rvm/bin/rvm list strings
ruby-1.9.2-p180

only returns 1.9.2 installed.

blt04 commented 13 years ago

It works for me, but only if I include ensure => 'present' in both rvm_system_ruby stanzas.

Also, what version of puppet are you using? When I add provider => rvm_system_ruby I get an error:

err: Could not run Puppet configuration client:
Parameter provider failed: Invalid rvm_system_ruby provider 'rvm_system_ruby'
jamtur01 commented 13 years ago

Ah I see. I forget the ensurable types need that. I could have sworn you could skip it.

And sorry I renamed your provider to make it consistent.

Puppet::Type.type(:rvm_system_ruby).provide(:rvm_system_ruby) do

I am testing with a bunch of different versions - 0.25.5, 2.6.2 and 2.6.8.

You can consider this PEBCAK.