# Inventory: IP's of all group members except self

**URL:** <https://forum.ansible.com/t/inventory-ips-of-all-group-members-except-self/16719>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [November 7, 2014, 2:40pm UTC](https://forum.ansible.com/t/inventory-ips-of-all-group-members-except-self/16719 "2014-11-07T14:40:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dirk\_Louwers](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@Dirk\_Louwers](https://forum.ansible.com/u/Dirk_Louwers)\
**Post date:** [November 7, 2014, 2:40pm UTC](https://forum.ansible.com/t/inventory-ips-of-all-group-members-except-self/16719/1 "2014-11-07T14:40:26Z")

</div>

Hi,

I just started out experimenting with roles from Ansible Galaxy. I came across a role that required the hosts of all other instances of this server. Since I keep all of them in the same group I was wondering how I can pass all of a groups IP’s to a role except for the machine’s own. Please let me know if this question isn’t clear.

Best,

Dirk

---

<div class="post-metadata">

**Author:** ![Hagai\_Kariti](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@Hagai\_Kariti](https://forum.ansible.com/u/Hagai_Kariti)\
**Post date:** [November 10, 2014, 8:14am UTC](https://forum.ansible.com/t/inventory-ips-of-all-group-members-except-self/16719/2 "2014-11-10T08:14:16Z")

</div>

If the inventory hostnames are enough, you can do this:

{{ groups.SOME\_GROUP | difference([inventory\_hostname]) | list }}
