Hi

It does not work because get_something can't parse the string 
"prefix_main_postfix" I need the value.

If I remove "| get_something" like this:

{{ 'prefix_' + item.env + '_postfix' }}

it just print the text 'prefix_main_postfix'

Den mandag den 23. februar 2015 kl. 16.34.08 UTC+1 skrev Jonathan Davila:
>
> 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/b3cd3985-7996-4767-a0c7-1997bfefd451%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to