Hello,

I have structured my roles such that redistributable roles, such as a role 
for installing mariadb, define as many of their variables in 
defaults/main.yml as possible. This way, any role that includes that 
redistributable role in its meta/main.yml can override that variable with a 
custom value by setting it in its vars/main.yml:

roles/mariadb/defaults/main.yml:

> ---
> mysql_password: "password1234"


roles/myserver/meta/main.yml:

> ---
> dependencies:
>   - { role: mariadb }


roles/myserver/vars/main.yml:

> ---
> mysql_password: "secretpassword"


Thus, myserver should have mysql_password set to "secretpassword" when it 
is run. This has worked well until recently, when it stopped working 
completely (possibly when I upgraded to 1.9.x). Now, it seems that a custom 
value defined in vars/main.yml does not override a default value in a meta 
role. I prefer overriding the variables in vars/main.yml rather than 
needing to override them in meta/main.yml because that can become a long, 
messy list.

Has variable precedence behavior changed recently, or can anyone explain 
why this has stopped working?

Thanks,

Andrew Martin

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1e3b8c17-5211-49c6-a002-8e1b9567f477%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to