# host\_pinned strategy not working as expected?

**URL:** <https://forum.ansible.com/t/host-pinned-strategy-not-working-as-expected/34181>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [November 11, 2020, 4:40pm UTC](https://forum.ansible.com/t/host-pinned-strategy-not-working-as-expected/34181 "2020-11-11T16:40:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cruscio](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cruscio/32/435_2.png) [@cruscio](https://forum.ansible.com/u/cruscio)\
**Post date:** [November 11, 2020, 4:40pm UTC](https://forum.ansible.com/t/host-pinned-strategy-not-working-as-expected/34181/1 "2020-11-11T16:40:40Z")

</div>

I have a playbook with a couple dozen tasks. It runs against 3000 Windows Server targets with 1000 forks and `strategy: host_pinned`. It takes about two hours to run to completion when 90% of servers have no changes to be made.

Had an idea to speed it up: Write a pre\_task that runs a powershell script to collect some basic info. All other tasks are in blocks with `when:` parameters that skip the block if the output of the pre\_task was correct. This took the runtime against one node from multiple minutes down to just a few seconds.

But a run against all 3000 servers still ran for just under two hours.

Looking at the individual logs for each host, there’s tens of seconds to multiple minutes between each skipped step - When there should be milliseconds, or a couple seconds at worst.

Almost like it’s waiting for other hosts to complete the step before it moves on… that’s the behavior I’d expect if I had set a `serial` value … not the behavior when using a large fork count and host\_pinned strategy

**Am I doing something wrong here? How can I speed up execution against individual hosts?**

---

<div class="post-metadata">

**Author:** ![Anitha\_sreejith](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@Anitha\_sreejith](https://forum.ansible.com/u/Anitha_sreejith)\
**Post date:** [November 11, 2020, 8:24pm UTC](https://forum.ansible.com/t/host-pinned-strategy-not-working-as-expected/34181/2 "2020-11-11T20:24:30Z")

</div>

Hello all,

I tried to create basic playbook to collect all windows facts. I could ping the server well but “ansible\_facts” is not giving me any info. I end up with error.

Whereas when I run ad hoc command using setup module I could see beautiful windows facts in Jason format. What is the issue when the same kind of output is expected from playbook.

Can anyone help please?

Regards,  
Anitha

---

<div class="post-metadata">

**Author:** ![Anitha\_sreejith](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@Anitha\_sreejith](https://forum.ansible.com/u/Anitha_sreejith)\
**Post date:** [November 11, 2020, 8:27pm UTC](https://forum.ansible.com/t/host-pinned-strategy-not-working-as-expected/34181/3 "2020-11-11T20:27:21Z")

</div>

Hello all,

I tried to create basic playbook to collect all windows facts. I could ping the server well but “ansible\_facts” is not giving me any info. I end up with error.

Whereas when I run ad hoc command using setup module I could see beautiful windows facts in Jason format. What is the issue when the same kind of output is expected from playbook.

Can anyone help please?

Regards,  
Anitha

---

<div class="post-metadata">

**Author:** ![Antony\_Stone](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Antony\_Stone](https://forum.ansible.com/u/Antony_Stone)\
**Post date:** [November 11, 2020, 8:31pm UTC](https://forum.ansible.com/t/host-pinned-strategy-not-working-as-expected/34181/4 "2020-11-11T20:31:20Z")

</div>

> Hello all,
> 
> I tried to create basic playbook to collect all windows facts. I could ping  
> the server well but "ansible\_facts" is not giving me any info. I end up  
> with error.

What is the error?

> Whereas when I run ad hoc command using setup module I could see beautiful  
> windows facts in Jason format.

What is the command?

> What is the issue when the same kind of output is expected from playbook.

Can you show us the playbook?

> Can anyone help please?

We need more information about exactly what you are doing and exactly what the  
result is.

Antony.
