How I have done this
Change group_vars/all like below:-
data:
parent1:
child1: somevalue1
child2: somevalue2
parent2:
child1: somevalue1
child2: somevalue2
Change in playbook.yml:-
- debug: msg={{ data[parent].child1 }}
Please share if you have any better solution :)