rvm / rvm1-ansible

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

Files in /tmp Cannot be Executed in Centos 7 #155

Closed coofercat closed 2 years ago

coofercat commented 7 years ago

By default, on Centos 7, files in /tmp cannot be executed (even if chmod 777) because the filesystem mount prevents it. The result is that all attempts to install RVM fail:

TASK [rvm_io.ruby : Install rvm] ******************************************************************************************************************************************************************************************************************
fatal: [myserver]: FAILED! => {"changed": false, "cmd": "/tmp/rvm-installer.sh stable --path /root/.rvm --auto-dotfiles --user-install", "failed": true, "msg": "[Errno 13] Permission denied", "rc": 13}

The solution is thankfully pretty simple - instead of running /tmp/something, just run /bin/bash /tmp/something. Therefore, in tasks/rvm.yml, the task to install RVM becomes:

- name: Install rvm
  command: >
    /bin/bash {{ rvm1_temp_download_path }}/rvm-installer.sh {{ rvm1_rvm_version }}
    --path {{ rvm1_install_path }} {{ rvm1_install_flags }}
  when: not rvm_binary.stat.exists

Incidentally, using shell instead of command doesn't work either. As far as I can see, this minor change will be compatible with other distributions and versions though, so hopefully low-risk.

isikyus commented 6 years ago

By default, on Centos 7, files in /tmp cannot be executed (even if chmod 777) because the filesystem mount prevents it. The result is that all attempts to install RVM fail:

This also affects Ubuntu 16.04.3.

terry-mccarthy commented 2 years ago

This seems to be still an issue .. workaround above works for me

stevenhaddox commented 2 years ago

This is still an issue it seems. I just encountered the same error on CentOS 8. The above change seems to get it working perfectly.