Check if bundler is in wrapper path, excluding global gemset.

This commit is contained in:
Kees Klerk
2015-12-14 14:02:58 +01:00
parent 247ff36d1d
commit 2615824a7c
2 changed files with 16 additions and 4 deletions

View File

@@ -24,13 +24,20 @@
when: detect_default_ruby_version.stdout == '' or
rvm1_default_ruby_version not in detect_default_ruby_version.stdout
- name: Detect installed ruby patch number
shell: >
{{ rvm1_rvm }} list strings | grep {{ item }} | tail -n 1
with_items: rvm1_rubies
changed_when: False
register: ruby_patch
- name: Install bundler if not installed
shell: >
{{ rvm1_install_path }}/wrappers/{{ item }}@global/gem list
| if ! grep "^bundler " ; then {{ rvm1_install_path }}/wrappers/{{ item }}@global/gem install bundler ; fi
ls {{ rvm1_install_path }}/wrappers/{{ item.stdout }}
| if ! grep "^bundler " ; then {{ rvm1_install_path }}/wrappers/{{ item.stdout }}/gem install bundler ; fi
args:
creates: '{{ rvm1_install_path }}/wrappers/{{ item }}@global/bundler'
with_items: rvm1_rubies
creates: '{{ rvm1_install_path }}/wrappers/{{ item.stdout }}/bundler'
with_items: ruby_patch.results
register: bundler_install
changed_when: '"Successfully installed bundler" in bundler_install.stdout'