On 11.05.2019 20:40, Saranya N wrote:
> I have a list of dictionary variables something like below in vars file.
> 
> App01:
>   A : value1
>   B : value2
>   C : value3
> 
> App02:
>    A : value4
>    C : value5
>    B : value6
> 
> And so on...
> 
> When I run my playbook with -e option app=01

"{{ hostvars[inventory_hostname]['App' ~ app] }}"

> or app=App01

"{{ hostvars[inventory_hostname][app] }}"

> I want to use App01 variables in with_items in my task .

App01 and App02 is not a list so you can't use with_items, but you could use 
with_dict instead.


-- 
Kai Stian Olstad

-- 
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/0029ab72-cb6b-ebae-dd01-5fe4b16512e8%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to