# installing rvm: setting environment for role

**URL:** <https://forum.ansible.com/t/installing-rvm-setting-environment-for-role/19563>\
**Category:** Ansible Project\
**Created:** [October 20, 2015, 1:57pm UTC](https://forum.ansible.com/t/installing-rvm-setting-environment-for-role/19563 "2015-10-20T13:57:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.grosmann](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@r.grosmann](https://forum.ansible.com/u/r.grosmann)\
**Post date:** [October 20, 2015, 1:57pm UTC](https://forum.ansible.com/t/installing-rvm-setting-environment-for-role/19563/1 "2015-10-20T13:57:16Z")

</div>

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](http://172.22.73.16:8080)  
https\_proxy: [https://172.22.73.16:80](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](http://github.com:443)  
curl: (35) Unknown SSL protocol error in connection to [bitbucket.org:443](http://bitbucket.org:443)  
stdout: Turning on auto dotfiles mode.  
Turning on user install mode.  
Downloading [https://github.com/rvm/rvm/archive/.tar.gz](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

---

<div class="post-metadata">

**Author:** ![r.grosmann](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@r.grosmann](https://forum.ansible.com/u/r.grosmann)\
**Post date:** [October 20, 2015, 3:01pm UTC](https://forum.ansible.com/t/installing-rvm-setting-environment-for-role/19563/2 "2015-10-20T15:01:16Z")

</div>

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
