rvm / rvm1-ansible

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

ansible installation fails with default ~/.rvm #164

Open stephanfriedrich opened 6 years ago

stephanfriedrich commented 6 years ago

Hi, i try to install rvm via ansible, but the role cant update rvm because the role rvm-path is incorrect. Imho, is my config correct. if i change the isntall-path to /usr/local/rvm installation finish successfully.

Ansible Error Log:

< TASK [rvm_io.ruby : Configure rvm] >
 ------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["~/.rvm/bin/rvm", "autolibs", "3"], 
"delta": "0:00:00.009191", "end": "2018-02-07 12:59:39.913111", "msg": "non-zero return code", "rc": 1, "start": "2018-02-07 12:59:39.903920", 
"stderr": "~/.rvm/bin/rvm: Zeile 55: /usr/local/rvm/scripts/rvm: No such file or directory\nError sourcing RVM!", 
"stderr_lines": ["~/.rvm/bin/rvm: Zeile 55: /usr/local/rvm/scripts/rvm: No such file or directory", "Error sourcing RVM!"], "stdout": "", "stdout_lines": []}

role-config:

dependencies:
  - { role: rvm_io.ruby,
      tags: ['install_all', 'install_rvm'],
      rvm1_install_flags: '--auto-dotfiles',    
      rvm1_rubies: "{{var_rubies}}",
      rvm1_rvm_check_for_updates: True,
      rvm1_rvm_version: 'stable',              
      rvm1_user: '{{ansible_install_user}}',
    }
stephanfriedrich commented 6 years ago

ok, i figured out why the issue occurs.

at first i had to update my rvm-role config with (like descriped in the readem):

To a user that is not ansible_user

You will need root access here because you will be writing outside the ansible user's home directory. Other than that it's the same as above, except you will supply a different user account:

rvm1_install_flags: '--auto-dotfiles --user-install'
rvm1_install_path: '/home/someuser/.rvm'

the issue

BUT , i dont know why the ansible-rvm-role dont know its current path, or why the shell wont reload the path.