Add rvm1_user so you can set the rvm directory owner

This commit is contained in:
Nick Janetakis
2014-12-12 08:20:59 -05:00
parent 2fc88e9a05
commit eac27af50c
3 changed files with 13 additions and 0 deletions

View File

@@ -40,6 +40,9 @@ rvm1_install_path: '/usr/local/lib/rvm'
# make sure you ADD the --user-install flag below # make sure you ADD the --user-install flag below
rvm1_install_flags: '--auto-dotfiles' rvm1_install_flags: '--auto-dotfiles'
# Set the owner for the rvm directory
rvm1_user: 'root'
# URL for the latest installer script # URL for the latest installer script
rvm1_rvm_latest_installer: 'https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer' rvm1_rvm_latest_installer: 'https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer'
@@ -100,6 +103,12 @@ rvm1_install_flags: '--auto-dotfiles --user-install'
rvm1_install_path: '/home/someuser/.rvm' rvm1_install_path: '/home/someuser/.rvm'
``` ```
#### A quick note about `rvm1_user`
In some cases you may want the rvm folder and its files to be owned by a specific
user instead of root. Simply set `rvm1_user: 'foo'` and when ruby gets installed
it will ensure that `foo` owns the rvm directory.
## Upgrading and removing old versions of ruby ## Upgrading and removing old versions of ruby
A common work flow for upgrading your ruby version would be: A common work flow for upgrading your ruby version would be:

View File

@@ -15,6 +15,9 @@ rvm1_install_path: '/usr/local/lib/rvm'
# make sure you ADD the --user-install flag below # make sure you ADD the --user-install flag below
rvm1_install_flags: '--auto-dotfiles' rvm1_install_flags: '--auto-dotfiles'
# Set the owner for the rvm directory
rvm1_user: 'root'
# URL for the latest installer script # URL for the latest installer script
rvm1_rvm_latest_installer: 'https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer' rvm1_rvm_latest_installer: 'https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer'

View File

@@ -12,6 +12,7 @@
command: '{{ rvm1_rvm }} install {{ item.item }}' command: '{{ rvm1_rvm }} install {{ item.item }}'
when: rvm1_rubies and item.rc != 0 when: rvm1_rubies and item.rc != 0
with_items: detect_rubies.results with_items: detect_rubies.results
sudo_user: '{{ rvm1_user }}'
- name: Detect default ruby version - name: Detect default ruby version
command: '{{ rvm1_rvm }} alias list default' command: '{{ rvm1_rvm }} alias list default'