On Monday, October 15, 2018 at 7:45:15 PM UTC-4, Guy Knights wrote:
>
> Is there any way to specify a suffix for the keyed_groups option in the 
> aws_ec2 inventory plugin? I'm looking at migrating from Ansible 2.4 to 2.6 
> and would like to switch from the old ec2 dynamic inventory script. 
> However, we currently specify our host groups as "<server type>_servers", 
> eg. "web_servers". Is there any way I can replicate this host group format 
> in the aws_ec2 plugin or am I out of luck?
>
> I know I could change the format of our host groups but I'd prefer not to 
> have to do that if possible as there are conditional includes, etc I'd have 
> to adjust as well.
>

Sure, just include the suffix in the key.

keyed_groups:
  - prefix: ''
    separator: ''
    key: tags.Class ~ '_servers'

 
    "all": {
        "children": [
            "aws_ec2", 
            "builder_servers", 
            "ctools_mx_servers", 
            "dev_servers", 
            "dnsbl_servers", 
            "egress_servers", 
            "jail_servers", 
            "master_servers", 
            "mx_servers", 
            "relay_egress_servers", 
            "syslog_servers", 
            "ungrouped"
        ]

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2bb67f08-245e-41df-95d2-de695b47914b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to