rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
271 stars 136 forks source link

Detect if rubies are installed doesn't look at the correct RVM when doing a user install #102

Closed cloudpracticeinc closed 7 years ago

cloudpracticeinc commented 8 years ago

become_user isn't called when checking which rubies are installed. This causes the module to think ruby is already installed for a user if the root user already has it installed.

In "tasks/rubies.yml"

  • name: Detect if rubies are installed
    command: '{{ rvm1_rvm }} {{ item }} do true'
    changed_when: False
    failed_when: False
    register: detect_rubies
    with_items: '{{ rvm1_rubies }}'
    when: rvm1_rubies

Should be:

  • name: Detect if rubies are installed
    command: '{{ rvm1_rvm }} {{ item }} do true'
    changed_when: False
    failed_when: False
    register: detect_rubies
    with_items: '{{ rvm1_rubies }}'
    become: yes
    become_user: '{{ rvm1_user }}'
    when: rvm1_rubies
lpaulmp commented 7 years ago

this was fixed in the last releases. https://github.com/rvm/rvm1-ansible/blob/master/tasks/main.yml#L8-L11