you can use the groups variable directly in your template, as it is a list, also you are stacking moustaches and that does not work!!!
no {{ {{ }} }} , you only need one set {{ }}, anything inside you do not quote is var: {% for server in groups['zookeepers'] %} server.{{ hostvars[server]["id"] }} = {{server}}:2888:3888 {% endfor %} -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8noC39FKukE%2B07-L82ANuK_B-X-Ac25W2%2B1e3UV7UC_Qg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.