# wait\_for and with\_items hangs

**URL:** <https://forum.ansible.com/t/wait-for-and-with-items-hangs/26036>\
**Category:** Ansible Project\
**Created:** [November 15, 2017, 3:54pm UTC](https://forum.ansible.com/t/wait-for-and-with-items-hangs/26036 "2017-11-15T15:54:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dean\_Kamali](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@Dean\_Kamali](https://forum.ansible.com/u/Dean_Kamali)\
**Post date:** [November 15, 2017, 3:54pm UTC](https://forum.ansible.com/t/wait-for-and-with-items-hangs/26036/1 "2017-11-15T15:54:26Z")

</div>

Hey everyone

I’m trying this combination, can’t figure out what I’m doing wrong,

When I try the following it works

- name: Wait for service  
wait\_for:  
path: /tmp/node-41.log  
search\_regex: ‘Docker is up and running’  
delegate\_to: localhost

However when I try and loop over hosts group, it hangs forever.

- name: Wait for service  
wait\_for:  
path: /tmp/node-41.log  
search\_regex: ‘Docker is up and running’  
delegate\_to: localhost  
with\_items: hosts.manager

Any ideas on why?

---

<div class="post-metadata">

**Author:** ![Dean\_Kamali](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@Dean\_Kamali](https://forum.ansible.com/u/Dean_Kamali)\
**Post date:** [November 15, 2017, 4:14pm UTC](https://forum.ansible.com/t/wait-for-and-with-items-hangs/26036/2 "2017-11-15T16:14:28Z")

</div>

Found it!

- name: Wait for service  
wait\_for:  
path: /tmp/{{ item }}.log  
search\_regex: ‘Docker is up and running’  
timeout: 5  
delegate\_to: localhost  
with\_items: “{{ groups[‘manager’] }}”
