## TL;DR

In this case, although the ssh daemon ends up being UP after few seconds, the task wait\_for\_connection fails (timeout). ### Issue Type Bug Report ### Component Name wait_for_connection ### Ansible Version ```console $ ansible --version ansible [core 2.14.4] config file = /tmp/test/ansible.cfg configured module search path = ['[HOME]/...', '/usr/share/ansible/plugins/module

## Steps

1. Issue ansible/ansible#80514 (closed, 17 comments): ### Summary I use `wait_for_connection` with `delegate_to: [IP]` to wait the ssh connection on host. But in the host, the ssh daemon is not UP immediately (this is why I use `wait_for_connection`). In this case, although the ssh daemon ends up being UP after few seconds, the task `wait_for_connection` fails (timeout). ### Issue Type Bug Report ### Component Name wait_for_connection ### Ansible Version ```console $ ansible --version ansible [core 2.14.4] config file = /tmp/test/ansible.cfg configured module search path = ['[HOME]/...', '/usr/share/ansible/plugins/module

2. wait_for_connection failing with delegate_to when SSH is temporarily down was resolved in ansible-core 2.17+ (commit 86fd702, duplicate of #78264). Upgrade. Separately, if your Python interpreter changes mid-play, run `- meta: clear_facts` before wait_for_connection (and gather_facts after) to fix interpreter-mismatch failures.

## When to use

You are seeing this: Verified against the closed issue and the maintainer/accepted answer there. Use this skill when you run into "Problem with wait_for_connection and delegate_to when SSH is not temporarily UP".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: core 2.14.4. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/ansible/ansible/issues/80514
