diff options
author | mesk41in <vit.shumilin@gmail.com> | 2017-07-04 17:51:05 +0300 |
---|---|---|
committer | Brian Coca <bcoca@users.noreply.github.com> | 2017-07-27 11:37:34 -0400 |
commit | 0fb64214a4ad54124f65daf17a48bda1b505e332 (patch) | |
tree | 406080491040ead2a5a937f0fed2360cd50bfc8a /lib/ansible/modules/inventory | |
parent | 7351ee9a762bd2156135391144ac06ed03adb296 (diff) | |
download | ansible-0fb64214a4ad54124f65daf17a48bda1b505e332.tar.gz |
add support of nested groups in group_by
Diffstat (limited to 'lib/ansible/modules/inventory')
-rw-r--r-- | lib/ansible/modules/inventory/group_by.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/ansible/modules/inventory/group_by.py b/lib/ansible/modules/inventory/group_by.py index 73e67625d7..7ee640c594 100644 --- a/lib/ansible/modules/inventory/group_by.py +++ b/lib/ansible/modules/inventory/group_by.py @@ -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 }} + ''' |