# Running ansible with inventories where hosts are overlapping

**URL:** <https://forum.ansible.com/t/running-ansible-with-inventories-where-hosts-are-overlapping/20398>\
**Category:** Ansible Project\
**Created:** [February 1, 2016, 10:26am UTC](https://forum.ansible.com/t/running-ansible-with-inventories-where-hosts-are-overlapping/20398 "2016-02-01T10:26:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilan\_NG](https://avatars.discourse-cdn.com/v4/letter/i/aca169/32.png) [@Ilan\_NG](https://forum.ansible.com/u/Ilan_NG)\
**Post date:** [February 1, 2016, 10:26am UTC](https://forum.ansible.com/t/running-ansible-with-inventories-where-hosts-are-overlapping/20398/1 "2016-02-01T10:26:27Z")

</div>

Hi,  
I have several inventories i use for my different environments (test, ci, production, etc.). in my inventory files i use static IP addresses as hosts (this is required, although i’m not sure it matters for my question)

Basically my inventory would look like this  
[child1]  
ip1

[child2]  
ip2

[parent:children]  
child1  
child2

and the play has “host: parent” as the hosts to run a particular play on.

This generally works fine except when in my env ip1==ip2. When that happens the play only runs once BUT i have different vars i want to run for “child1” and “child2” and i DO want it to run multiple times (once for each child)  
How can i force ansible to run for all children in this instance?

Tx in advance

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 1, 2016, 3:17pm UTC](https://forum.ansible.com/t/running-ansible-with-inventories-where-hosts-are-overlapping/20398/2 "2016-02-01T15:17:05Z")

</div>

Use aliases in the inventory and set ansible\_ssh\_host to the actual  
IP, ansible uniques on 'inventory\_hostname' so you can point at the  
same host more than once as long as it has different names.
