I figured it out. You can just do the following and it will work.
{% for host in groups[VAR] %}
On Thursday, November 12, 2015 at 7:50:18 AM UTC-5, Edgardo Vega wrote:
>
> I am trying to do the following where I index groups by a variable instead
> of hardcoding it. Is that possible somehow?
>
> {% for host in groups['{{VAR}}'] %}
> STUFF
> {% endfor %}
>
>
> Thanks in advance,
>
> Edgardo
>
>
>
--
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/60f9943c-89df-4f84-8023-9790a4611a73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.