Skip to content

Commit

Permalink
Fix a bug with how the upgrade task checked for rvm
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjj committed Jun 3, 2014
1 parent 71e3e12 commit 250810a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: detect rvm profile
stat: path=/etc/profile.d/rvm.sh
register: rvm_profile
- name: detect rvm binary
stat: path={{ ruby_rvm_install_path }}/bin/rvm
register: rvm_binary

- name: detect rvm installer
stat: path={{ ruby_temp_download_path }}/rvm-installer.sh
Expand All @@ -10,7 +10,7 @@
- name: detect current rvm version
shell: "{{ ruby_rvm_install_path }}/bin/rvm version"
register: rvm_current_version
when: rvm_profile.stat.exists
when: rvm_binary.stat.exists

- name: detect stable rvm version from url
uri: url={{ ruby_rvm_stable_version_number }} return_content=yes
Expand All @@ -31,19 +31,19 @@
file:
path: "{{ ruby_temp_download_path }}/rvm-installer.sh"
mode: 0755
when: not rvm_profile.stat.exists or ruby_rvm_force_upgrade_installer
when: not rvm_binary.stat.exists or ruby_rvm_force_upgrade_installer

- name: ensure rvm stable is installed
command: "{{ ruby_temp_download_path }}/rvm-installer.sh --path {{ ruby_rvm_install_path }} stable"
when: not rvm_profile.stat.exists
when: not rvm_binary.stat.exists

- name: ensure rvm is upgraded
shell: "{{ ruby_rvm_install_path }}/bin/rvm get stable && {{ ruby_rvm_install_path }}/bin/rvm reload"
when: rvm_stable_version_number.content|default(ruby_rvm_stable_version_number)|replace("\n", "") > rvm_current_version.stdout.split()[1] and rvm_profile.stat.exists
when: rvm_binary.stat.exists and rvm_stable_version_number.content|default(ruby_rvm_stable_version_number)|replace("\n", "") > rvm_current_version.stdout.split()[1]

- name: ensure rvm installs ruby dependencies
command: "{{ ruby_rvm_install_path }}/bin/rvm autolibs 3"
when: not rvm_profile.stat.exists
when: not rvm_binary.stat.exists

- name: detect if ruby version is installed
stat: path={{ ruby_rvm_install_path }}/rubies/ruby-{{ ruby_version }}
Expand Down

0 comments on commit 250810a

Please sign in to comment.