I’m having trouble defining groups that include dynamic nodes defined by EC2.py. This is specific to defining group_vars by groups that don’t explicitly refer to a particular dynamic host name. For example, I have a group of dynamically-created servers that I refer to by tag. The dynamic host name is:
tag_Environment_staging
But I’d like to refer to these as just “staging” in my group vars. So, in order to do this I define an inventory as follows:
`
[tag_Environment_staging]
[staging:children]
tag_Environment_staging
`
I have to place that first tag inside brackets in order to use it with the group-of-groups feature. One problem with this is that I’m only able to execute commands across all my staging servers, and am not able to target individual servers while still including the “staging” group vars. What I’d prefer is to write my inventory file like:
[staging:children] tag_Name_staging_*
So then I could target a specific server using:
ansible tag_Name_staging_featureA -m ping
And ansible would know to associate that particular server with the appropriate group variables. So basically just need a way to define group-of-groups using wildcards. Is there another way I might do this?