Is there a simple way to find host groups for a role?

Given an Ansible playbook, is there a simple way to list out all host groups that a given roles belongs to?

My roles install applications using RPMs. If there is a fix in an application, I need to know what servers I should update.

Thank you,
/Sergey

–list-hosts option is what you want.

It isn’t I am not seeing --limit working conjunction with --list-hosts 2.0.beta as it did in 1.9. I was search through here is to see if others were making the same observation.

E.g.: This provides all hosts in an inventory without the requested limit:

ansible -i inventory --limit [group|host] --list-hosts all

If limiting is of interest, --list-hosts had and continues to exhibit limiting behavior. Just now, it is the required way to limit.

ansible -i inventory --list-hosts [group|host]

This is a much more succinct, but may break existing expectations.