From 411b20814766159e7e3fa2d7a626ed0294823f22 Mon Sep 17 00:00:00 2001 From: Gabriel Suarez Date: Tue, 3 Sep 2019 20:33:47 +0100 Subject: [PATCH] Add example of "parent_group" usage in aws_ec2.py (#60430) ##### SUMMARY Looks like the "parent_group" option in "keyed_groups" is a very recent feature that is not being documented. This pull request just adds a simple example of the usage of this useful feature. ##### ISSUE TYPE - Docs Pull Request +label: docsite_pr --- lib/ansible/plugins/inventory/aws_ec2.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/plugins/inventory/aws_ec2.py b/lib/ansible/plugins/inventory/aws_ec2.py index a565220f266..5f757956162 100644 --- a/lib/ansible/plugins/inventory/aws_ec2.py +++ b/lib/ansible/plugins/inventory/aws_ec2.py @@ -138,6 +138,10 @@ keyed_groups: # Create a group per region e.g. aws_region_us_east_2 - key: placement.region prefix: aws_region + # Create a group (or groups) based on the value of a custom tag "Role" and add them to a metagroup called "project" + - key: tags['Role'] + prefix: foo + parent_group: "project" # Set individual variables with compose compose: # Use the private IP address to connect to the host