Merge pull request #79 from alettieri/patch/#78
Ensure a default value is supplied when detecting ruby, fixes #78
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
- name: Install rubies
|
- name: Install rubies
|
||||||
command: '{{ rvm1_rvm }} install {{ item.item }} {{ rvm1_ruby_install_flags }}'
|
command: '{{ rvm1_rvm }} install {{ item.item }} {{ rvm1_ruby_install_flags }}'
|
||||||
when: rvm1_rubies and item.rc != 0
|
when: rvm1_rubies and item.rc|default(0) != 0
|
||||||
with_items: detect_rubies.results
|
with_items: detect_rubies.results
|
||||||
sudo_user: '{{ rvm1_user }}'
|
sudo_user: '{{ rvm1_user }}'
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
- name: Select default ruby
|
- name: Select default ruby
|
||||||
command: '{{ rvm1_rvm }} alias create default {{ rvm1_default_ruby_version }}'
|
command: '{{ rvm1_rvm }} alias create default {{ rvm1_default_ruby_version }}'
|
||||||
when: detect_default_ruby_version.stdout == '' or
|
when: detect_default_ruby_version.stdout|default() == '' or
|
||||||
rvm1_default_ruby_version not in detect_default_ruby_version.stdout
|
rvm1_default_ruby_version not in detect_default_ruby_version.stdout
|
||||||
|
|
||||||
- name: Detect installed ruby patch number
|
- name: Detect installed ruby patch number
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
with_items: rvm1_rubies
|
with_items: rvm1_rubies
|
||||||
changed_when: False
|
changed_when: False
|
||||||
register: ruby_patch
|
register: ruby_patch
|
||||||
|
always_run: yes # Run even when in --check mode (http://docs.ansible.com/ansible/playbooks_checkmode.html)
|
||||||
|
|
||||||
- name: Install bundler if not installed
|
- name: Install bundler if not installed
|
||||||
shell: >
|
shell: >
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
with_items: ruby_patch.results
|
with_items: ruby_patch.results
|
||||||
register: bundler_install
|
register: bundler_install
|
||||||
changed_when: '"Successfully installed bundler" in bundler_install.stdout'
|
changed_when: '"Successfully installed bundler" in bundler_install.stdout'
|
||||||
|
|
||||||
- name: Symlink ruby related binaries on the system path
|
- name: Symlink ruby related binaries on the system path
|
||||||
file:
|
file:
|
||||||
state: 'link'
|
state: 'link'
|
||||||
@@ -50,7 +51,7 @@
|
|||||||
group: 'root'
|
group: 'root'
|
||||||
when: not '--user-install' in rvm1_install_flags
|
when: not '--user-install' in rvm1_install_flags
|
||||||
with_items: rvm1_symlink_binaries
|
with_items: rvm1_symlink_binaries
|
||||||
|
|
||||||
- name: Detect if ruby version can be deleted
|
- name: Detect if ruby version can be deleted
|
||||||
command: '{{ rvm1_rvm }} {{ rvm1_delete_ruby }} do true'
|
command: '{{ rvm1_rvm }} {{ rvm1_delete_ruby }} do true'
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|||||||
Reference in New Issue
Block a user