Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Updated version of my original PR #7292 to incorporate nested group changes #8676
referenced this pull request
Aug 19, 2014
Context from previous PR:
In my current environment, I rely heavily on AWS tags to describe the purpose of boxes, and roles are applied specifically to them via tag values. In instances where a machine is filling more than one role, I needed the flexibility to target specific instances by tag grouping. This commit aims to prevent a significant amount of tags being required by expanding a CSV value for a tag into a list of values.
The hostvars ec2_tag_foo value becomes a list of tag values from splitting the field by comma, and an additional group tag_foo_value is added to the inventory for each of the CSV values.
An example of one of the machine tags is:
Without this commit, the value is interpreted as: ec2_tag_role = 'webserver_dns_ssh_logger' and in the inventory there is a key [tag_role_webserver_dns_ssh_logger]
With this commit, the value is interpreted as: ec2_tag_role = [
and in the inventory there are groups: [tag_role_webserver], [tag_role_dns], [tag_role_ssh], [tag_role_logger]
Therefore buying the flexibility of being able to target instances by specific role, and avoiding having to create a tonne of additional tags/hostgroup handlers