rvm / rvm1-ansible

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

Last value from rvm1_rubies even if rvm1_default_ruby_version is set #163

Open bolshakov opened 6 years ago

bolshakov commented 6 years ago

Inventory file:

app:
  hosts:
    127.0.0.1:
      rvm1_rubies:
        - "ruby-2.1.1"
        - "ruby-2.3.5"
      rvm1_default_ruby_version: "ruby-2.1.1"

My playbook looks like this:

- hosts: app
  roles:
    - rvm_io.ruby
    - my_role

In my_role I use rvm1_default_ruby_version value to configure apache. I expect it is ruby-2.1.1, but actually it is set to ruby-2.3.5.

I factored tests app to reproduce the issue and print rvm1_default_ruby_version before, inside and after my role. It prints ruby-2.1.1, ruby-2.3.5 and ruby-2.1.1. I expect it is ruby-2.1.1.

TL;DR; inside my role rvm1_default_ruby_version does not equal to value set in inventory file.

Possibly related issue https://github.com/rvm/rvm1-ansible/issues/34

lpaulmp commented 6 years ago

@bolshakov thanks for open this issue, I'll investigate it

thbar commented 6 years ago

I have the same problem: any override of rvm1_default_ruby_version I make is replaced. I'm using Ansible 2.4.3.

I wonder if maybe the variables defined by the role are late-evaluated & always winning.