installing rvm: setting environment for role

36 views
Skip to first unread message

r144

unread,
Oct 20, 2015, 9:57:16 AM10/20/15
to Ansible Project
hello group,

In order to install rvm for a user, I have tried the rvm1-ansible role.
My playbook looks like this:

 roles:
    - machine
    - role: rvm_io.rvm1-ruby
      sudo: True
      rvm1_user: 'fuser'
      rvm1_rvm_version: 'stable'                              
      rvm1_rvm_check_for_updates: false                       
      rvm1_gpg_keys: ''
      rvm1_rubies:
        - 'ruby-1.9.3'
      rvm1_install_flags: '--auto-dotfiles --user-install'
      rvm1_install_path: '/home/fuser/.rvm'

    

The problem with this is that the brand new user 'fuser' has no proper proxy settings. The remote user uses it's sudo capabilities to login as user fuser, but the environment somehow gets lost.

I have tried setting the proxy using environment: on  the role level with
    environment:
      http_proxy:     http://172.22.73.16:8080
      https_proxy:    https://172.22.73.16:80


but they are simply not used: the install still fails with

failed: [172.22.25.227] => {"changed": true, "cmd": ["/tmp/rvm-installer.sh", "stable", "--path", "/home/fuser/.rvm", "--auto-dotfiles", "--user-install"], "delta": "0:00:05.098454", "end": "2015-10-20 15:27:01.115946", "rc": 35, "start": "2015-10-20 15:26:56.017492"}
stderr: curl: (35) Unknown SSL protocol error in connection to github.com:443
curl: (35) Unknown SSL protocol error in connection to bitbucket.org:443
stdout: Turning on auto dotfiles mode.
Turning on user install mode.
Downloading https://github.com/rvm/rvm/archive/.tar.gz




Does anyone have an idea how I can work around this? Can I specify the https-proxy somewhere in the playbooks, or can I put those settings in a startup file that gets used when logging in as fuser? Do I have to tweak the sudo configuration somehow?

thanks in advance, Ruud

r144

unread,
Oct 20, 2015, 11:01:16 AM10/20/15
to Ansible Project

I have solved it by writing first a .curlrc file to the users home directory.
But still I am curious how to solve it using the ansible modules itself.

Ideas?

Ruud
Reply all
Reply to author
Forward
0 new messages