Hi Kai, Im using roles/vars file, so how do I achieve it?
App01: A : value1 B : value2 C : value3 App02: A : value4 C : value5 B : value6 And so on... Also passing different values now, when -e app=data01_kerb something like this, if it has 01 , then choose App01's dictionary ' if app=data02_syn then choose App02's dictionary... is this possible? Im passing app=data01_try , coz Im trying to derive/set_fact another variable from this value. Any suggestions would be helpfull. or any best way to achive this? On Sunday, May 12, 2019 at 12:19:41 AM UTC+5:30, Kai Stian Olstad wrote: > > 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c0d3f67c-87be-4895-abfe-d362db027dc0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.