blt04 / puppet-rvm

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

"include rvm" fails because curl is not installed #47

Closed kaazoo closed 11 years ago

kaazoo commented 12 years ago

This is the error message when I include the rvm module on Ubuntu 12.04 x64:

# puppet agent --test --verbose --onetime
info: Retrieving plugin
info: Loading facts in /var/lib/puppet/lib/facter/rvm_installed.rb
info: Loading facts in /var/lib/puppet/lib/facter/3ware.rb
info: Caching catalog for gshc4.artcom.de
info: Applying configuration version '1337778790'
err: /Stage[rvm-install]/Rvm::System/Exec[system-rvm]/returns: change from notrun to 0 failed: bash -c '/usr/bin/curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer -o /tmp/rvm-installer ;                 chmod +x /tmp/rvm-installer ;                 rvm_bin_path=/usr/local/rvm/bin rvm_man_path=/usr/local/rvm/man /tmp/rvm-installer --version latest ;                 rm /tmp/rvm-installer' returned 1 instead of one of [0] at /etc/puppet/modules/rvm/manifests/system.pp:12

Curl wasn't installed, allthough it is specified in dependency file for Ubuntu.

blt04 commented 12 years ago

If you install curl manually via apt-get, does it work? I've used the puppet rvm module on Ubuntu 12.04 with no problems.

kaazoo commented 12 years ago

It works when I manually install curl before running puppet again.

Paso commented 12 years ago

Same here.

I guess it is because rvm::system doesn't "require" curl but only includes it (through "rvm::dependencies"). If package{curl:...} is defined by the user before rvm is included, it will be removed from "rvm::dependencies" by the "if ! defined"-statement.

I'm afraid I'm not familiar enough with puppet to be able to suggest a fix though.

ryanfitz commented 11 years ago

I'm also running into this when trying to set up a new system (without curl already installed).

I have a puppet script which declares that the curl package should be installed before rvm, but for some reason it seems to have no effect.

err: /Stage[rvm-install]/Rvm::System/Exec[system-rvm]/returns: change from notrun to 0 failed: bash -c '/usr/bin/curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer -o /tmp/rvm-installer ;
chmod +x /tmp/rvm-installer ; rvm_bin_path=/usr/local/rvm/bin rvm_man_path=/usr/local/rvm/man /tmp/rvm-installer --version latest ; rm /tmp/rvm-installer' returned 1 instead of one of [0] at /mnt /hgfs/fitz/Code/workstation/modules/rvm/manifests/system.pp:12

err: Could not find a suitable provider for rvm_system_ruby

ryanfitz commented 11 years ago

I figured out what is going on. The rvm puppet module runs in stages, the rvm installer runs before the main puppet stage. During this rvm-install stage it checks to see if it needs to install curl using - if ! defined(Package['curl'])

The problem happens when you have declared elsewhere in your manifest to install curl. The rvm installer will skip trying to install curl, because the install of curl is declared elsewhere, however, curl won't get installed until during the main stage run. The rvm-install stage will fail (curl not found) and puppet will abort running the main stage so curl will never get installed.

I fixed this by creating another stage which installs curl before the rvm-install stage runs.