rvm / rvm1-ansible

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

Role fails with latest version of rvm (i.e. 1.29.3) #159

Closed vikas027 closed 7 years ago

vikas027 commented 7 years ago

Environment

OS: CentOS 7 x86_64 Platform: AWS

Problem

rvm v1.29.3 released a few days ago spits out below error while using the role

TASK [rvm_io.ruby : Symlink ruby related binaries on the system path] ************************************************************************************************************************************************************************
changed: [127.0.0.1] => (item=erb) => {"changed": true, "dest": "/usr/local/bin/erb", "gid": 0, "group": "root", "item": "erb", "mode": "0777", "owner": "root", "secontext": "unconfined_u:object_r:bin_t:s0", "size": 35, "src": "/usr/local/rvm/wrappers/default/erb", "state": "link", "uid": 0}
changed: [127.0.0.1] => (item=executable-hooks-uninstaller) => {"changed": true, "dest": "/usr/local/bin/executable-hooks-uninstaller", "gid": 0, "group": "root", "item": "executable-hooks-uninstaller", "mode": "0777", "owner": "root", "secontext": "unconfined_u:object_r:bin_t:s0", "size": 60, "src": "/usr/local/rvm/wrappers/default/executable-hooks-uninstaller", "state": "link", "uid": 0}
changed: [127.0.0.1] => (item=gem) => {"changed": true, "dest": "/usr/local/bin/gem", "gid": 0, "group": "root", "item": "gem", "mode": "0777", "owner": "root", "secontext": "unconfined_u:object_r:bin_t:s0", "size": 35, "src": "/usr/local/rvm/wrappers/default/gem", "state": "link", "uid": 0}
changed: [127.0.0.1] => (item=irb) => {"changed": true, "dest": "/usr/local/bin/irb", "gid": 0, "group": "root", "item": "irb", "mode": "0777", "owner": "root", "secontext": "unconfined_u:object_r:bin_t:s0", "size": 35, "src": "/usr/local/rvm/wrappers/default/irb", "state": "link", "uid": 0}
changed: [127.0.0.1] => (item=rake) => {"changed": true, "dest": "/usr/local/bin/rake", "gid": 0, "group": "root", "item": "rake", "mode": "0777", "owner": "root", "secontext": "unconfined_u:object_r:bin_t:s0", "size": 36, "src": "/usr/local/rvm/wrappers/default/rake", "state": "link", "uid": 0}
changed: [127.0.0.1] => (item=rdoc) => {"changed": true, "dest": "/usr/local/bin/rdoc", "gid": 0, "group": "root", "item": "rdoc", "mode": "0777", "owner": "root", "secontext": "unconfined_u:object_r:bin_t:s0", "size": 36, "src": "/usr/local/rvm/wrappers/default/rdoc", "state": "link", "uid": 0}
changed: [127.0.0.1] => (item=ri) => {"changed": true, "dest": "/usr/local/bin/ri", "gid": 0, "group": "root", "item": "ri", "mode": "0777", "owner": "root", "secontext": "unconfined_u:object_r:bin_t:s0", "size": 34, "src": "/usr/local/rvm/wrappers/default/ri", "state": "link", "uid": 0}
changed: [127.0.0.1] => (item=ruby) => {"changed": true, "dest": "/usr/local/bin/ruby", "gid": 0, "group": "root", "item": "ruby", "mode": "0777", "owner": "root", "secontext": "unconfined_u:object_r:bin_t:s0", "size": 36, "src": "/usr/local/rvm/wrappers/default/ruby", "state": "link", "uid": 0}
failed: [127.0.0.1] (item=testrb) => {"failed": true, "item": "testrb", "msg": "src file does not exist, use \"force=yes\" if you really want to create the link: /usr/local/rvm/wrappers/default/testrb", "path": "/usr/local/bin/testrb", "src": "/usr/local/rvm/wrappers/default/testrb", "state": "absent"}
    to retry, use: --limit @/home/ec2-user/abc.retry

PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
127.0.0.1                  : ok=13   changed=6    unreachable=0    failed=1  

Workaround

Pin rvm version 1.29.2 (default is stable) in the role, something like this

  roles:
    - { role: rvm_io.ruby,
        rvm1_rubies: ['ruby-2.4.0'],
        rvm1_install_flags: '--auto-dotfiles',
        rvm1_install_path: /usr/local/rvm,
        rvm1_user: root,
        rvm1_rvm_version: 1.29.2
      }
lpaulmp commented 7 years ago

@vikas027 this issue was address a couple of days ago? Could you try using the last version of the role v2.0.1 ?

vikas027 commented 7 years ago

Hey @lpaulmp, I just did an ansible-galaxy install rvm_io.ruby. I was assuming it would take the latest version automatically. No?

lpaulmp commented 7 years ago

@vikas027 this should take the last one. Did the version 2.0.1 resolved your issue?

vikas027 commented 7 years ago

@lpaulmp Yeah, it worked now. I have pinned the version now in the command ansible-galaxy install rvm_io.ruby,v2.0.1

Thanks, for your help. I am closing the ticket.