Fix a bug with how the upgrade task checked for rvm

This commit is contained in:
Nick Janetakis
2014-06-03 08:52:24 -04:00
parent 71e3e121de
commit 250810aa74

View File

@@ -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
@@ -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
@@ -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 }}