ansible/ansible — pull request #271 by jhoekx (2012-04-28 16:28:13+00:00)
Title: Introduce group_names in template variables.

This is a list of all the groups a host is in. Fixes issue #196.

Example:

In a template:
```
{% if 'oracle' in group_names %}
This is an oracle node
{% else %}
This is not oracle
{% endif %}
```

After running this on three nodes:

```
(ansible)[jeroen@firefly work]$ ansible all -m shell -a 'cat /root/group-template.txt'
rh6oranode1 | success | rc=0 >>
This is an oracle node

rh6oranode2 | success | rc=0 >>
This is an oracle node

rh6rear | success | rc=0 >>
This is not oracle
```