Skip to content

Regression: rubies are not installed #209

@thbar

Description

@thbar

I believe #204 introduced a regression which forbids the installation of the configured rubies, at least for me on Ansible 2.8.3.

In this code:

- name: Install rubies
command: '{{ rvm1_rvm }} install {{ item.item }} {{ rvm1_ruby_install_flags }}'
when: rvm1_rubies | bool and item.rc|default(0) != 0
with_items: '{{ detect_rubies.results }}'

the rvm1_rubies | bool expression evaluates to false, which makes the install be skipped:

TASK [rvm.ruby : Install rubies] *************************************************************************
skipping: [vagrant-geo] => (item={'skip_reason': u'Conditional result was False', 'item': u'ruby-2.5.3', 'skipped': True, 'ansible_loop_var': u'item', 'changed': False}) 

This later results in an error during Install bundler if not installed, as reported by @AwolDes here:

#204 (comment)

Because no ruby is installed, the default alias is created, but the link resolves to a non-existing folder.

The explanation is here:

https://medium.com/opsops/wft-bool-filter-in-ansible-e7e2fd7a148f

[1,2,3]|bool -> false

I believe #207 and #208 are proposals to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions