Great!
This is what I needed:

{% for host in play_hosts %}

Thank you.


On Wednesday, March 25, 2015 at 3:54:43 PM UTC+2, Yariv Graf wrote:
>
> Hi,
> I have this code of template for zookeeper role:
>
> {% for host in groups['all'] %}
> server.{{ hostvars[host].zookeeper_id }}={{ 
> hostvars[host]['ansible_hostname'] }}:2888:3888
> {% endfor %}
>
>
> In this example it applies for all hosts in the inventory file.
> I know you can specify a group like : groups['zookeepers'] but I need to 
> apply it on the current group the role runs on.
> Is it possible?
>
> Thanks
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/328f2c3f-cd42-4275-bc77-b5b3b3343021%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to