Hi guys,
I want to get all existent subgroups from a parent group.
Example Playbook:
---
- hosts: "test"
tasks:
- group_by:
key: "{{ansible_distribution}}-{{ansible_distribution_major_version}}"
parents: "dist"
- debug: var="{{ groups['dist'] }}"
run_once: true
#unfortunately I only get all the hosts of the parent group instead the groups created by 'group_by'
#Something like {% for group in groups['dist'] %} .... {% endfor %} ??
#or this:
- name: test
command: echo {{ item }}
with_items: "{{ groups['dist'] }}"
delegate_to: localhost
run_once: true
#-> only hosts... :-(
Any ideas?
Thanks,
starflighter
Ansible-Version:
ansible 2.4.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]