add support of nested groups in group_by

This commit is contained in:
mesk41in 2017-07-04 17:51:05 +03:00 committed by Brian Coca
commit 0fb64214a4
4 changed files with 46 additions and 6 deletions

View file

@ -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"] }