{ "kind": "Endpoints", "apiVersion": "v1", "metadata": { "name": "glusterfs-cluster" }, "subsets": [ { "addresses": [ { {% for host in groups['gfs-cluster'] %} "ip": "{{hostvars[host]['ansible_eth0']['ipv4']['address']}}"{%- if not loop.last %}, {% endif -%} {% endfor %} } ], "ports": [ { "port": 1 } ] } ] }