blt04 / puppet-rvm

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

Doesn't work with puppet 2.7.1 #12

Closed egze closed 13 years ago

egze commented 13 years ago

I'm trying to install rvm with ree and ruby-1.9.3

I'm getting these errors: err: Could not run Puppet configuration client: Could not find a default provider for rvm_gem err: Could not run Puppet configuration client: Could not find a default provider for rvm_system_ruby

This is my config

node 'ubuntu' {
        include rvm::system

        rvm_system_ruby {
                'ruby-1.9.3-preview1':
                        ensure => 'present',
                        default_use => true;
                'ree-1.8.7-2011.03':
                        ensure => 'present',
                        default_use => false;
        }
        rvm_gem {
                'bundler193':
                        name => 'bundler',
                        ruby_version => 'ruby-1.9.3-preview1',
                        ensure => '1.0.15',
                        require => Rvm_system_ruby['ruby-1.9.3-preview1'];
                'bundler187':
                        name => 'bundler',
                        ruby_version => 'ree-1.8.7-2011.03',
                        ensure => '1.0.15',
                        require => Rvm_system_ruby['ree-1.8.7-2011.03'];
        }

}

It works fine with puppet 2.6.9

What am I missing here?

tracead commented 13 years ago

I am also having problem with this on 2.7.1 (The default in Vagrants default lucid64.box):

vagrant@lucid64:~$ sudo puppet apply --debug --verbose --modulepath /tmp/vagrant-puppet/modules-0 /tmp/vagrant-puppet/manifests/base.pp info: Loading facts in rvm_installed debug: Failed to load library 'selinux' for feature 'selinux' debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/init.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/dependencies-centos.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/dependencies-ubuntu.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/dependencies.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/passenger-centos-post.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/passenger-centos-pre.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/passenger-gem.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/passenger-ubuntu-post.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/passenger-ubuntu-pre.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/passenger.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/classes/system.pp' in environment production debug: importing '/tmp/vagrant-puppet/modules-0/rvm/manifests/definitions/system_user.pp' in environment production Could not find class rvm::system for lucid64.localdomain at /tmp/vagrant-puppet/manifests/base.pp:26 on node lucid64.localdomain

blt04 commented 13 years ago

Hi egze. Could you try wrapping your rvm_system_ruby and rvm_gem blocks with if $rvm_installed == "true":

node 'ubuntu' {
    include rvm::system

    if $rvm_installed == "true" {
        rvm_system_ruby {
            'ruby-1.9.3-preview1':
                    ensure => 'present',
                    default_use => true;
            'ree-1.8.7-2011.03':
                    ensure => 'present',
                    default_use => false;
        }
        rvm_gem {
            'bundler193':
                    name => 'bundler',
                    ruby_version => 'ruby-1.9.3-preview1',
                    ensure => '1.0.15',
                    require => Rvm_system_ruby['ruby-1.9.3-preview1'];
            'bundler187':
                    name => 'bundler',
                    ruby_version => 'ree-1.8.7-2011.03',
                    ensure => '1.0.15',
                    require => Rvm_system_ruby['ree-1.8.7-2011.03'];
        }
    }
}

See the Troubleshooting section in the README

blt04 commented 13 years ago

@tracead: Try adding:

[main]
    pluginsync = true

to your puppet.conf file. See the Using Custom Types section in the README.

If that doesn't help, please open a new issue as your problem appears to be a different issue from egze's.

ashwoods commented 13 years ago

@tracead: added a new issue

hunter commented 13 years ago

I'm finding that I get the same errors (and a few more) with 2.7.1 on the lucid32 box. If I include $rvm_installed == "true" conditional then the rvm_system_ruby is never executed (and on each run the rvm install gets run). If I don't include the conditional then I get:

debug: Puppet::Type::Rvm_gem::ProviderGem: file /usr/local/bin/rvm does not exist
Could not find a default provider for rvm_gem

I'm also getting errors if i try to add system users (eg. rvm::system_user { vagrant: ; } ). I get the error:

Could not find dependency User[vagrant] for Exec[/usr/sbin/usermod -a -G rvm vagrant] at /tmp/vagrant-puppet/modules-0/rvm/manifests/definitions/system_user.pp:12

Its seems like puppet, rvm and vagrant don't play well together.

egze commented 13 years ago

Yes, same for me.

If I include $rvm_installed == "true" conditional then the rvm_system_ruby is never executed

blt04 commented 13 years ago

Please see my comments on issue #14. I have tested the latest commits with puppet 2.7.1 and everything works fine. Please comment/reopen this issue if you are still having problems.

hunter commented 13 years ago

Just confirming that most of my issues are fixed. RVM, rubies and gems are all installed with the condition.

The only thing that is still failing is adding a system_user (same error as in my post above). Was that running successfully for you?

blt04 commented 13 years ago

You must define a user elsewhere in your manifest when using rvm::system_user. All rvm::system_user does is add an existing user to the rvm group.

I've updated the README to reflect this.

hunter commented 13 years ago

Ah, bad assumption on my part. Thanks :)