How to use keyed_groups in constructed EC2 inventory with a single tag?

117 views
Skip to first unread message

WhileLoop

unread,
Jun 5, 2018, 5:55:04 PM6/5/18
to Ansible Project
Currently inventory.aws_ec2.yaml looks like this:


plugin: aws_ec2
regions
:
 
- us-west-2
keyed_groups
:
 
- prefix: tag
    key
: tags


This creates one group for every tag combination. How can make it look at a single tag only? For example if only wanted it to create one group for each value of the "Environment" tag.

Gert van den Berg

unread,
Sep 18, 2019, 5:23:24 AM9/18/19
to Ansible Project
keyed_groups:
  - key: tags.Environment
    separator: ''
    prefix: env    # This is optional

 
Reply all
Reply to author
Forward
0 new messages