# Execute a task on host using weight.

**URL:** <https://forum.ansible.com/t/execute-a-task-on-host-using-weight/20557>\
**Category:** Ansible Developer\
**Created:** [February 12, 2016, 8:38am UTC](https://forum.ansible.com/t/execute-a-task-on-host-using-weight/20557 "2016-02-12T08:38:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexey\_Lesovsky](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Alexey\_Lesovsky](https://forum.ansible.com/u/Alexey_Lesovsky)\
**Post date:** [February 12, 2016, 8:38am UTC](https://forum.ansible.com/t/execute-a-task-on-host-using-weight/20557/1 "2016-02-12T08:38:44Z")

</div>

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.
