# Raw tag/value pairs as group names

**URL:** <https://forum.ansible.com/t/raw-tag-value-pairs-as-group-names/14222>\
**Category:** Ansible Project\
**Created:** [December 26, 2013, 9:16pm UTC](https://forum.ansible.com/t/raw-tag-value-pairs-as-group-names/14222 "2013-12-26T21:16:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![herby.gillot](https://avatars.discourse-cdn.com/v4/letter/h/c68b51/32.png) [@herby.gillot](https://forum.ansible.com/u/herby.gillot)\
**Post date:** [December 26, 2013, 9:16pm UTC](https://forum.ansible.com/t/raw-tag-value-pairs-as-group-names/14222/1 "2013-12-26T21:16:58Z")

</div>

RE: [https://github.com/ansible/ansible/pull/5430](https://github.com/ansible/ansible/pull/5430)

The intent here was to make it possible for users of the ec2 inventory module to be able to directly address hosts using groups in the format of ‘=’

The patch does not change existing behavior, and keeps the legacy format of host groups for tags to look like ‘tag\_\_’ by default.

Say I have a tag named ‘role’ across some subset of instances, and the value of this tag can be set to things like ‘builder’, ‘packer’ or ‘shipper’.

Using the ec2 inventory plugin as is, to run a playbook across all host instances whose ‘role’ tag is set to ‘builder’, one would need to:

ansible-playbook -i ./inventory ./playbooks/builders.yml -l tag\_role\_builder

It would be nice to simply be able to do:

ansible-playbook -i ./inventory ./playbooks/builders.yml -l role=builder

And now you can also define your playbooks to have:

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [December 27, 2013, 2:42pm UTC](https://forum.ansible.com/t/raw-tag-value-pairs-as-group-names/14222/2 "2013-12-27T14:42:05Z")

</div>

I was suggesting this be posed on ansible-devel list btw, will let you post there and we can discuss.

– Michael

---

<div class="post-metadata">

**Author:** ![herby.gillot](https://avatars.discourse-cdn.com/v4/letter/h/c68b51/32.png) [@herby.gillot](https://forum.ansible.com/u/herby.gillot)\
**Post date:** [December 27, 2013, 2:44pm UTC](https://forum.ansible.com/t/raw-tag-value-pairs-as-group-names/14222/3 "2013-12-27T14:44:25Z")

</div>

Ah, apologies. Will move discussion over.
