summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/inventory
diff options
context:
space:
mode:
authormesk41in <vit.shumilin@gmail.com>2017-07-04 17:51:05 +0300
committerBrian Coca <bcoca@users.noreply.github.com>2017-07-27 11:37:34 -0400
commit0fb64214a4ad54124f65daf17a48bda1b505e332 (patch)
tree406080491040ead2a5a937f0fed2360cd50bfc8a /lib/ansible/modules/inventory
parent7351ee9a762bd2156135391144ac06ed03adb296 (diff)
downloadansible-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.py13
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 }}
+
'''