mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
add support of nested groups in group_by
This commit is contained in:
parent
7351ee9a76
commit
0fb64214a4
4 changed files with 46 additions and 6 deletions
|
@ -185,3 +185,21 @@
|
|||
tasks:
|
||||
- name: check group_vars variable overrides for camelus
|
||||
assert: { that: ["uno == 1", "dos == 'two'", "tres == 3"] }
|
||||
|
||||
- name: Nested group validation
|
||||
hosts: lama
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: group by genus with parent
|
||||
group_by: key=vicugna-{{ genus }} parents=vicugna
|
||||
- name: check group_vars variable overrides for vicugna-lama
|
||||
assert: { that: ["uno == 1", "dos == 2", "tres == 'three'"] }
|
||||
|
||||
- name: group by genus with nonexistent parent
|
||||
group_by:
|
||||
key: "{{ genus }}"
|
||||
parents:
|
||||
- oxydactylus
|
||||
- stenomylus
|
||||
- name: check parent groups
|
||||
assert: { that: ["'oxydactylus' in group_names", "'stenomylus' in group_names"] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue