Hi,
In a template, I use “{{ vars[varname] }}”. “varname” is a default var declared this way “varname: {{ another_var }}”.
I would expect in the template to get the value of another_var, not the name of another_var.
I have reproduced the problem in test/integration/targets/var_blending at this gist https://gist.github.com/tlvu/ade0a36dc426eea4b9f6a28381cc1fc1 (runme.sh pass).
I am using version 2.3.0.0 (stable-2.3 c92765e26e).
The real usecase for this is I’d like to do something like {{ vars[prefix + ‘_token’] }} in a template and prefix would be declared as “prefix: {{ prod_prefix }}” or “prefix: {{ staging_prefix }}” depending on the inventory file used. I think this usecase is immensely useful so I was a bit surprised it did not work.
If there is an existing bug, please point me to it. I did search for “recursive vars expansion” and did not find anything useful.
If there is any work-around, please let me know because I am pretty stuck right now.
Thanks,
Long