mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
add support of nested groups in group_by
This commit is contained in:
@@ -33,6 +33,12 @@ options:
|
||||
description:
|
||||
- The variables whose values will be used as groups
|
||||
required: true
|
||||
parents:
|
||||
description:
|
||||
- The list of the parent groups
|
||||
required: false
|
||||
default: "all"
|
||||
version_added: "2.4"
|
||||
author: "Jeroen Hoekx (@jhoekx)"
|
||||
notes:
|
||||
- Spaces in group names are converted to dashes '-'.
|
||||
@@ -47,4 +53,11 @@ EXAMPLES = '''
|
||||
# Create groups like 'kvm-host'
|
||||
- group_by:
|
||||
key: virt_{{ ansible_virtualization_type }}_{{ ansible_virtualization_role }}
|
||||
|
||||
# Create nested groups
|
||||
- group_by:
|
||||
key: el{{ ansible_distribution_major_version }}-{{ ansible_architecture }}
|
||||
parents:
|
||||
- el{{ ansible_distribution_major_version }}
|
||||
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user