variable for list of targetted hosts

Hello dear Ansible wizards

Is there a way to get the list of targetted hosts for a playbook or for a role ?

I didnt find any variable or any way to get this.

What I’m looking for is not merely the hosts: value, it is the intersection of hosts values and -l ( --limit ) option.

Thank you

$ ansible -i INVENTORY all -m setup --limit vm04 --list-hosts

the play_hosts var should have that list (unless you are using serial, which limits it per batch)

Yes,it is working, thanks.
This is exactly what I was looking for.