Inventory: IP's of all group members except self

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

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

{{ groups.SOME_GROUP | difference([inventory_hostname]) | list }}