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

-- 

This email or any attachments may contain confidential or legally 
privileged information intended for the sole use of the addressees. Any 
use, redistribution, disclosure, or reproduction of this information, 
except as intended, is prohibited. If you received this email in error, 
please notify the sender and remove all copies of the message, including 
any attachments.

-- 
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/965bc192-ef41-4c3f-8cef-e4cef00c90e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to