From f4bc91eb5061216536eb1ebdaa23821a513b7699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Niewi=C5=84ski?= Date: Fri, 22 Jul 2016 00:26:45 -0700 Subject: [PATCH] rvm autolibs option is now customizable --- README.md | 8 +++++++- defaults/main.yml | 1 + tasks/install_rvm.yml | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8ae99b7..dbb7c9f 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,14 @@ Role Variables - `rvm_url` per default set to `https://get.rvm.io` - `rvm_root` per default set to `/usr/local/rvm` - `rvm_init_script` per default set to `/etc/profile.d/rvm.sh` +- `rvm_autolibs` per default set to `3` - 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) -The latest two variables have presented values because installation runs with root permissions by default (if you passed `-s` option when you're running your playbook) +The `rvm_root` and `rvm_init_script` have presented values because installation runs with root permissions by default (if you passed `-s` option when you're running your playbook) License ------- diff --git a/defaults/main.yml b/defaults/main.yml index 5fe4501..a711df0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,3 +13,4 @@ rvm_root: /usr/local/rvm rvm_init_script: /etc/profile.d/rvm.sh rvm_auto_update_rvm: true rvm_ruby_version: ruby-2.2.0 +rvm_autolibs: 3 diff --git a/tasks/install_rvm.yml b/tasks/install_rvm.yml index 49d0f84..3502e56 100644 --- a/tasks/install_rvm.yml +++ b/tasks/install_rvm.yml @@ -19,5 +19,5 @@ path: "{{rvm.temp_installer_path}}" state: absent -- name: setting RVM autolibs on - command: "{{rvm_root}}/bin/rvm autolibs 3" +- name: setting RVM autolibs option + command: "{{rvm_root}}/bin/rvm autolibs {{rvm_autolibs}}"