This Ansible role installs RVM as root and the required ruby version.
If user isn't root (executing without sudo) then RVM will be installed to the user home directory,
but you need to change paths to it own RVM through variables rvm_root
and rvm_init_script
.
Tested with CentOS 6.4, 6.5, 7.0, Debian 6.0.10, 7.8, 8.1, Fedora 18, 19, 20, 21, Ubuntu 10.04, 12.04, 13.10, 14.04, 14.10
rvm_install_type
per default set tosystem
(valid values:system
,user
)rvm_default_ruby_version
per default set toruby-2.2.2
rvm_auto_update_rvm
per default set totrue
rvm_autolibs
per default set to3
- controls automatic installation of dependencies of rvm and ruby (if needed)0
-> Do not do anything (not installing dependencies and ruby or rvm can be unusable after installation)1
-> Use available libs, ignore missing (ruby or rvm can be unusable after installation)2
-> Use libs, fail if some are missing (good option for local installation on user without package manager access)3
-> Use libs, install missing libs (works if you have package manager rights)4
-> Install missing package manager (only OSX, on Linux it's like 3)
rvm_url
per default set tohttps://get.rvm.io
rvm_root
per default set to/usr/local/rvm
rvm_init_script
per default set to/etc/profile.d/rvm.sh
The last two variables are set according to whether a system
-wide install (Multi-User install), or a Single-User install has been chosen with rvm_install_type
.
The playbook runs with root permissions by default if the ansible_ssh_user
that is running your playbook has sudo
privileges, and rvm_install_type
is set to system
.
When the playbook is run with rvm_install_type = user
, the playbook will install RVM to the home directory of the ansible_ssh_user
.
The defaults for the last two variables are then:
rvm_root
:~/.rvm
rvm_init_script
:~/.rvm/scripts/rvm
Licensed under MIT. Do what you want with it.