# Iterate over inventory groups in parallel

**URL:** <https://forum.ansible.com/t/iterate-over-inventory-groups-in-parallel/26340>\
**Category:** Ansible Developer\
**Created:** [December 20, 2017, 12:30pm UTC](https://forum.ansible.com/t/iterate-over-inventory-groups-in-parallel/26340 "2017-12-20T12:30:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinod\_kumar4](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vinod\_kumar4](https://forum.ansible.com/u/vinod_kumar4)\
**Post date:** [December 20, 2017, 12:30pm UTC](https://forum.ansible.com/t/iterate-over-inventory-groups-in-parallel/26340/1 "2017-12-20T12:30:56Z")

</div>

Hi,

I’m looking to iterate over inventory groups something like below,

inventory:

[names]  
vinod  
manoj  
suraj

[places]  
bangalore  
mangalore  
mysore

And i’m trying to make a variable to contain as,

variable\_dict= “vinod:bangalore manoj:mangalore suraj:mysore”

Searched some of the ansible way of getting above, but much luck.  
Any help on this much appreciated.

Thanks,  
Vinod

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [December 20, 2017, 3:49pm UTC](https://forum.ansible.com/t/iterate-over-inventory-groups-in-parallel/26340/2 "2017-12-20T15:49:03Z")

</div>

This should give you the beginning of what you need  
"{{groups["names"]|product(groups["places"])|map('join',':')|list}}"
