better way to list available tags?

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

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

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.