Hello,

I'd like to loop over all hosts that are in scope of the current task in
a template.

Currently I use a fixed groupname as seen in the following block, but
that will break if the scope doesn't match the groupname.

Is there a way to say loop over all hosts in scope of current task?

{% for host in groups['groupname'] %}
        {% for item in hostvars[host]['varfoo']['results'] -%}$
                {{ item.stdout }},
        {%- endfor %}
{% endfor %}


thanks,
Nusenu

-- 
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/54E9DB99.7070203%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to