# better way to list available tags?

**URL:** <https://forum.ansible.com/t/better-way-to-list-available-tags/14192>\
**Category:** Ansible Project\
**Created:** [December 20, 2013, 11:36am UTC](https://forum.ansible.com/t/better-way-to-list-available-tags/14192 "2013-12-20T11:36:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seb.stark](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@seb.stark](https://forum.ansible.com/u/seb.stark)\
**Post date:** [December 20, 2013, 11:36am UTC](https://forum.ansible.com/t/better-way-to-list-available-tags/14192/1 "2013-12-20T11:36:00Z")

</div>

Hi,

is there a better way to list available tags than this:

#!/bin/zsh

ansible-playbook ${1-site.yml} --tags=“does\_not\_exist” | sed ‘s/.\*possible values: //;s/,/\n/g’ | column -c 120

I had a look at the python api, especially the ansible.playbook module. As it turns out doing this via the api is not trivial without replicating code (like getting all plays in the playbook and run compare\_tags for each).

Any hints?

Sebastian

---

<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 20, 2013, 2:31pm UTC](https://forum.ansible.com/t/better-way-to-list-available-tags/14192/2 "2013-12-20T14:31:04Z")

</div>

yeah, leave off the sed part on the end and just read it 🙂

---

<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 20, 2013, 2:31pm UTC](https://forum.ansible.com/t/better-way-to-list-available-tags/14192/3 "2013-12-20T14:31:57Z")

</div>

It would be better to just implement --list-tags, though this code should not be in bin/ansible-playbook as we also have a note to move the --list-tags code out sometime and make it use more of the core implementation.
