diff --git a/README.md b/README.md index 60f00aa..4e7dc4e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ rvm1_install_path: '/usr/local/lib/rvm' # make sure you ADD the --user-install flag below rvm1_install_flags: '--auto-dotfiles' +# Set the owner for the rvm directory +rvm1_user: 'root' + # URL for the latest installer script 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' ``` +#### 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 A common work flow for upgrading your ruby version would be: diff --git a/defaults/main.yml b/defaults/main.yml index 107cbae..5aedc92 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -15,6 +15,9 @@ rvm1_install_path: '/usr/local/lib/rvm' # make sure you ADD the --user-install flag below rvm1_install_flags: '--auto-dotfiles' +# Set the owner for the rvm directory +rvm1_user: 'root' + # URL for the latest installer script rvm1_rvm_latest_installer: 'https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer' diff --git a/tasks/rubies.yml b/tasks/rubies.yml index bdcfcbe..9eb7ad9 100644 --- a/tasks/rubies.yml +++ b/tasks/rubies.yml @@ -12,6 +12,7 @@ command: '{{ rvm1_rvm }} install {{ item.item }}' when: rvm1_rubies and item.rc != 0 with_items: detect_rubies.results + sudo_user: '{{ rvm1_user }}' - name: Detect default ruby version command: '{{ rvm1_rvm }} alias list default'