rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
271 stars 136 forks source link

install rvm installer fails #68

Closed ruudgrosmann closed 8 years ago

ruudgrosmann commented 8 years ago

After successfully installing rvm on a test server with rvm1-ansible, I tried to do the same on another machine (the same ubuntu version)

This fails with TASK: [rvm_io.rvm1-ruby | Detect rvm installer] *** ok: [host.nl] => {"changed": false, "stat": {"exists": false}}

TASK: [rvm_io.rvm1-ruby | Detect current rvm version] ***** skipping: [host.nl]

TASK: [rvm_io.rvm1-ruby | Install rvm installer] ****** failed: [host.nl] => {"failed": true} msg: Failed to validate the SSL certificate for raw.githubusercontent.com:443. Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine. You can use validate_certs=False if you do not need to confirm the server\s identity but this is unsafe and not recommended Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible

Googling around, I found an advice to upgrade to ansible 1.9, which I did, but this results in exactly the same message.

$ ansible-playbook --version ansible-playbook 1.9.4

I hope you can help me out. Ruud

ruudgrosmann commented 8 years ago

the strange thing is that I get the error using this playbook fragment:

- role: rvm_io.rvm1-ruby
  when: installeer_ruby
  sudo: true
  rvm1_user: '{{rvmuser}}'
  rvm1_rvm_version: 'stable'
  rvm1_rvm_check_for_updates: false
  rvm1_gpg_keys: ''
  rvm1_rubies:
    - 'ruby-1.9.3-p551'
  rvm1_install_flags: '--auto-dotfiles --user-install'
  rvm1_install_path: '/home/{{rvmuser}}/.rvm'
  environment:
     http_proxy:     http://172.4.7.16:8080
     https_proxy:    https://172.4.2.7.16:80

After the failure I log in as the specified user and can do a manual install without problem using curl -sSL https://get.rvm.io | bash -s stable Which I assume is the underlying action of the install task. Nevertheless the playbook gives me that error. When I rerun the playbook after the manual install, the task is not skipped, but tried again, leading to the same message

ruudgrosmann commented 8 years ago

I saw in your playbook that the task 'install rvm installer' actually does this: curl -sSL https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer> /tmp//rvm-installer.sh I did that manually and the step was skipped indeed. Thereafter, it hangs at TASK: [rvm_io.rvm1-ruby | Install bundler if not installed] *** and eventually reports: stderr: ERROR: Could not find a valid gem 'bundler' (>= 0), here is why: Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Connection timed out - connect(2) (https://api.rubygems.org/specs.4.8.gz)

It appears that that can only be fixed manually by setting the http-proxy in the shell. OR by inserting the environment var htttps_prody in your task (like in my 2nd post, but that obviously does noting) Is there another way to easily use a proxy with this rvm1-ansible role?

And I still have to tackle the certificate problem properly.

nickjj commented 8 years ago

Setting up a proxy seems a bit out of scope for this role, check out this related issue https://github.com/rvm/rvm1-ansible/issues/6.

ruudgrosmann commented 8 years ago

I already did what was suggested there, namely supplying a .curlrc. But this only works for the curl commands. And not for the rvm commands. If I only know how I can feed the shell with the necessary environment variables, I would be greatly helped. Don't you have an advice on this? I don;t want to tamper with the rvm1-ansible code. When I add them to your code, it works all right, but this not a solution. Isn't there a config file or so that the shell loads when the role commands are run?

nickjj commented 8 years ago

Unfortunately I'm not an expert with rvm. This role just helps you get rvm installed via ansible. @mpapis, any ideas?

ruudgrosmann commented 8 years ago

mpapis en nick, although I feel really shamed, I want to report that the problem is gone after deleting the user (with its rvm install and config files) and running the same (previously failing) playbook again. I want to thank you for your time spent on this.

nickjj commented 8 years ago

No problem, glad you got it working.