Look at the group_names variable. It contains a list of all groups the host is in.
On Wednesday, May 18, 2016, 'Chris Short' via Ansible Project < [email protected]> wrote: > I would like to use our inventory group names as a variable in a template > file. Has anyone had any success doing this? > > -- > 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] > <javascript:_e(%7B%7D,'cvml','ansible-project%[email protected]');> > . > To post to this group, send email to [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/51ab946f-cfab-4fb8-b463-81d31b93526d%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/51ab946f-cfab-4fb8-b463-81d31b93526d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Matt Martz @sivel sivel.net -- 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/CAD8N0v8ch16BV7oYAuMpuLZoyG8F6xUDNC3hnxr9sHgU7dq1Vg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
