There was suggestion on irc channel to define it as:
choosen_app_version: "{{ 'versions_' + choosen_app }}"
still evaluates to
choosen_app_version: versions_appA
W dniu czwartek, 17 grudnia 2015 15:57:30 UTC+1 użytkownik sirkubax napisał:
>
> Is it possible to double template the vars?
> vars:
> versions_appA: '1.2.3.4'
> versions_appB: '4.3.2.1'
>
> in tasks (for jinja template):
>
> the ideal would be (this is fake):
> - set_fact:
> choosen_app: 'appA'
> choosen_app_version: "{{ versions_{{ choosen_app }} }}"
>
> Expected result
> choosen_app_version: '1.2.3.4'
>
>
> I can get as close as:
> - set_fact:
> choosen_app_version_tmp: "versions_{{ choosen_app | default() }}"
> - set_fact:
> choosen_app_version: "{{ choosen_app_version_tmp }}"
>
> that evaluates to
> choosen_app_version: versions_appA
> (I need version number - not a name of the variable)
>
>
--
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/72f39da1-154b-4c00-accf-8fb0e7c0dc50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.