>From a quick look 
at https://github.com/ansible/ansible/blob/devel/lib/ansible/inventory/group.py 
I think the answer is "no" as child_groups doesn't have a getter, but just 
in case..

Is it possible to get the list of child groups of a given group?

The use case here would be for a jinja template (pseudo):

{% for my_group in groups['my-cluster'] %}
    {
      "name" : "{{ my_group.name }}",
      "hosts" : [
      {% for host in groups['{{ my_group.name }}] %}{"fqdn" : "{{ 
hostvars[host]['inventory_hostname'] }}"}{% if not loop.last %},{% endif %}
      {% endfor %}]
    }{% if not loop.last %},{% endif %}
{% endfor %}


There is an easy workaround which involves some duplication, but just 
curious if there's a way to get the above to work.




-- 
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/25a78285-d9cb-466d-864c-d12b67adc831%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to