From d93009044074ad5389e6370f6e74ed36af9376e8 Mon Sep 17 00:00:00 2001 From: Nick Janetakis Date: Mon, 23 Jun 2014 15:23:36 -0400 Subject: [PATCH] Simplify selecting a default ruby --- tasks/main.yml | 14 +++----------- tests/test_home.yml | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 868a853..a7b7d04 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -57,14 +57,6 @@ command: "{{ ruby_rvm_install_path }}/bin/rvm alias list default" register: ruby_selected -- name: detect if rvm is system installed - stat: path=/etc/profile.d/rvm.sh - register: rvm_system_install - -- name: ensure default ruby is selected (home install) - command: "{{ ruby_rvm_install_path }}/bin/rvm --default use ruby-{{ ruby_version }}" - when: not rvm_system_install.stat.exists and (ruby_selected.stdout == '' or ruby_version not in ruby_selected.stdout) - -- name: ensure default ruby is selected (system install) - shell: source /etc/profile.d/rvm.sh && rvm --default use ruby-{{ ruby_version }} executable=/bin/bash - when: rvm_system_install.stat.exists and (ruby_selected.stdout == '' or ruby_version not in ruby_selected.stdout) +- name: ensure default ruby is selected + command: "{{ ruby_rvm_install_path }}/bin/rvm alias create default ruby-{{ ruby_version }}" + when: ruby_selected.stdout == '' or ruby_version not in ruby_selected.stdout diff --git a/tests/test_home.yml b/tests/test_home.yml index 7cee745..f863092 100644 --- a/tests/test_home.yml +++ b/tests/test_home.yml @@ -4,7 +4,7 @@ sudo: true vars: ruby_temp_download_path: /home/travis/tmp - ruby_rvm_install_path: /home/travis/.rmv + ruby_rvm_install_path: /home/travis/.rvm roles: - ansible-ruby \ No newline at end of file