Try taking out the middle curly braces. So like:
{{ 'prefix_' + item.env + '_postfix' | get_something }}
If you are declaring vars with the vars construct, you don't need to
reference vars as a dict, the key/values are directly available.
Let me know if that helps.
On Sunday, February 22, 2015 at 8:35:39 AM UTC-5, Khuong Dinh Pham wrote:
>
> Hi
>
> In v1.7.2 It was possible to do this i a template:
>
> {{ vars['prefix_' + {{ item.env }} + '_postfix' ] | get_something }}
>
> But it's not working anymore in v.1.8.x. It just say that variable
> 'prefix_main_postfix' does not exist in dict
>
> Can i somehow concat a string and use it as variable name in Ansible
> v.1.8.x?
>
--
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/6acd2a75-790c-47ea-98a2-cfd496e2adcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.