Any Updates here? :-( I still need something like this... Am Dienstag, 12. Dezember 2017 10:39:45 UTC+1 schrieb [email protected]: > > 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] > > >
-- 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/a6408ec2-54c4-4222-b200-aeee7f37f11f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
