jinja2 templated variables do not expand

I am not sure if its my misuse of jinja within ansible, but I am seeing strange behavior from what would seem to be a typical use case for managing dynamic variables. As you can see from the code below, I am using the mysql_os variable to determine the list to select items from. This may be the intended behavior, but I swear I have done this in the past. I tested on 2.3, and 2.2 with the same results.

`

If I remember correctly, it does not work, when you define a variable and try to use it in same “block” in this case vars:

Both mysql_os and mysql_el6_base are defined in vars, so when expanding mysql_el6_base the mysql_os is not yet defined.

And the solution I used was to separate them into multiple vars_files.