Merge pull request #90 from kavehv/update_become

Update become method
This commit is contained in:
Paul Montero
2016-04-06 03:35:58 +02:00
2 changed files with 10 additions and 5 deletions

View File

@@ -12,7 +12,8 @@
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|default(0) != 0 when: rvm1_rubies and item.rc|default(0) != 0
with_items: detect_rubies.results with_items: detect_rubies.results
sudo_user: '{{ rvm1_user }}' become: yes
become_user: '{{ rvm1_user }}'
- name: Detect default ruby version - name: Detect default ruby version
command: '{{ rvm1_rvm }} alias list default' command: '{{ rvm1_rvm }} alias list default'

View File

@@ -30,22 +30,26 @@
command: 'gpg --keyserver {{ rvm1_gpg_key_server }} --recv-keys {{ rvm1_gpg_keys }}' command: 'gpg --keyserver {{ rvm1_gpg_key_server }} --recv-keys {{ rvm1_gpg_keys }}'
changed_when: False changed_when: False
when: rvm1_gpg_keys != '' when: rvm1_gpg_keys != ''
sudo_user: '{{ rvm1_user }}' become: yes
become_user: '{{ rvm1_user }}'
- name: Install rvm - name: Install rvm
command: > command: >
{{ rvm1_temp_download_path }}/rvm-installer.sh {{ rvm1_rvm_version }} {{ rvm1_temp_download_path }}/rvm-installer.sh {{ rvm1_rvm_version }}
--path {{ rvm1_install_path }} {{ rvm1_install_flags }} --path {{ rvm1_install_path }} {{ rvm1_install_flags }}
when: not rvm_binary.stat.exists when: not rvm_binary.stat.exists
sudo_user: '{{ rvm1_user }}' become: yes
become_user: '{{ rvm1_user }}'
- name: Update rvm - name: Update rvm
shell: '{{ rvm1_rvm }} get {{ rvm1_rvm_version }} && {{ rvm1_rvm }} reload' shell: '{{ rvm1_rvm }} get {{ rvm1_rvm_version }} && {{ rvm1_rvm }} reload'
changed_when: False changed_when: False
when: rvm_binary.stat.exists and rvm1_rvm_check_for_updates when: rvm_binary.stat.exists and rvm1_rvm_check_for_updates
sudo_user: '{{ rvm1_user }}' become: yes
become_user: '{{ rvm1_user }}'
- name: Configure rvm - name: Configure rvm
command: '{{ rvm1_rvm }} autolibs {{ rvm1_autolib_mode }}' command: '{{ rvm1_rvm }} autolibs {{ rvm1_autolib_mode }}'
when: not rvm_binary.stat.exists when: not rvm_binary.stat.exists
sudo_user: '{{ rvm1_user }}' become: yes
become_user: '{{ rvm1_user }}'