# Pastebin zvD5ZNcv Clearly in the jinja template though, it's looped to increment nodeid nodelist { {% set nodeid = 0 %} {% for host in groups['hacluster'] %} {% set nodeid = nodeid + 1 %} node { ring0_addr: {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }} name: {{ hostvars[host]['ansible_hostname'] }} nodeid: {{ nodeid }} } {% endfor %}