wait_for and with_items hangs

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?

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’] }}”