Use hostvars as hosts names in playbooks

Dear ansible users,

I try to write a paybook where I first get a host name from a host, then would like to do thinks on this host name.

Here is a try:

hostvars are not usable in 'hosts:' clause, use group_by if you want
to create adhoc groups for use in subsequent plays.

thanks, thought I discovered delegate_to which seems to be exacly what I need, i.e. a playbook on the new vm with preliminary tasks executed on hypervisors to setup the vm, then tasks on the vm, then I may add tasks delegated_to backup servers to register host for example. Nice!