Execute a task on host using weight.

Hello,

I have following situation, I have a group of hosts and playbook that has played on this group. I want run one task from playbook on specified host. This host is chosen using set_fact. The set_fact gathers “weight” from all hosts and host with max weight should be chosen for this task. If weights between hosts are equal, use first host.

Is it possible? Thanks.